Here you have:
https://playcanvas.com/editor/scene/1461947
The blue door is inside a loop with 2 animations, open and close.
The green one has speed control, and its range is also limited, so you can control it and it will not get stuck.
The red one has speed control, but its range is not limited, therefore it will get stuck and will also delay its opening.