Thanks, but I had to put delays in. Without any delays, the servo just rotates continuously and uncontrollably. With only one delay, it does a quarter rotation and snaps back.
In that case it sounds like you will need a time based approach - the automatic door thing suggests that on movement detection, you wish to move the servo, have it stay for a while & then return to the default position.
I'd suggest that you drop the delays and record the time using millis every time you see movement. In addition when that happens, move the servo to the "door open" position - if it's already moved or moving, no harm done.
When you haven't seen movement for a while, return to your start position. This way, the system will react quickly to movement when needed, but not react to rapid changes in PIR state.