For what you are doing, you can also use this method:

Code:
WaitForDoor:
    IF DoorOpen <> 0 THEN WaitForDoor