If you have a 48-pole stepper, then 90 degrees is 12 steps.
If the button is down, you want the stepper to move to position 12.
If the button is up, you want the stepper to move to position 0.
The stepper starts in position 0.
the loop makes the following decisions:
read the button, and decide where the stepper should be
if the stepper is already at that position, then do nothing and return.
look at what the time is since the last time the stepper was moved
if this is less then the delay time, do nothing and return
Otherwise,
increment or decrement the position by 1 to move it closer to where it should be .
change the outputs to match the current position (see below).
record the time at which this step was taken.
To change the outputs of the stepper to match the current position, do the following:
Extract bit 0 and bit 1 of the position:
boolean bit0 = (position & 0b01);
boolean bit1 = (position & 0b10);
if bit1 is set then reverse bit0
bit0 = (bit0 != bit1);
This gives you your pattern.
digitalWrite(motorPin1, bit0 ? HIGH : LOW);
digitalWrite(motorPin2, bit1 ? HIGH : LOW);
digitalWrite(motorPin3, bit0 ? LOW : HIGH);
digitalWrite(motorPin4, bit1 ? LOW : HIGH);
A difficulty is that position 0 of the stepper might not actually be the 'down' position exactly, depending on how the stepper is oriented. You may have to define the open and close positions as numbers other than 0 and 12.
Another difficulty is that this procedure never turns the stepper off. It may be that in the up position, the steeper shoul hold, but in the down position, it should be turned off. This can be added later, once you have your door opening and closing.