Help with project using stepper motor and limit switch

Hi!
I'm working on a small project for a device that has a door and limit switch, where I need to control a 28BYJ-48 stepper motor using the ULN2003 driver. I'm a mechanical engineer so probably could figure this out eventually, although I find the mechanical part of the build more fun than the programming – sorry!
I’m looking for some help, and willing to pay a little.
I need the stepper motor to do the following:

  1. Turn anticlockwise at 5 to 10 rpm until it hits a limit switch to zero itself (door is open)
  2. Turn clockwise about 45 degrees (250 steps, ish to be refined when fully built) at 5 to 10 rpm (door is closed)
  3. Stay in that (closed) position for 20 minutes
  4. Turn anticlockwise at 5 to 10 rpm until it hits the limit switch again (door is open)
  5. Repeat from step 2.

Optional extras:
a) If there is a way to change the delay in step 3 without going into the program and downloading it again to the arduino, that would be great e.g., a dial that goes from 5 minutes to 1 hour.
b)Potentiometer (or other way) to change the speed at which the door opens and closes.
c)Joystick to "override" at any point to manually control the door position anywhere between the limit switch and 250 (or whatever) steps in the other direction. Then have a button to set it back to "automatic" mode from steps 1 to 5, starting from door closed position.
Kind regards

"Turn ... at 5 to 10 rpm"
Well, I think 10 rpm will be hard to achieve, the best I could manage was over 7 seconds a revolution, so 10 revolutions would need 70 seconds. But you can get close. It is a geared motor, at 5V you can only make the step pulses so fast before the motor stops turning and just hums/vibrates some.
Here's a youtube demo

The rest is pretty straight forward.
Go the intended direction, detect switch contact, go the other direction for the needed time, or steps.
Stay there as long as directed by analogRead() of a pot (0 to 1023), divide by 16 and hold for the resulting number of minutes (1023/16 = 64)
Turn back until limit switch is hit again.

Read a pot to change speed, it's already pretty slow, but yes, that can be done.
Read joystick (really, just another pot) with perhaps a button to let the code know that manual positioning is being used.
Read a button to start over, that is easy also.

@Crossroads: I assume you mean that the motor can't be driven to 300 steps/second (I calculated 341 for 10 RPM) at 5V? If so, and OP wants to continue using that driver (why?). He could use L/R drive and a 12V supply with a current limiting resistor. It will waste a bunch of power, but it's possible to get a higher speed out of the motor that way.

OP: one other problem with old ULN2003 driver (really: it's antiquated!!) is that you can only drive half the motor coil at a time, so you get greatly reduced torque. If you upgrade to an H-Bridge driver, you might be able to get a higher speed out of the motor without going to L/R drive (another antiquated drive method).

I've had no issues running a 28BYJ-48 at 10 rpm. The limit I got it to was more like 30 rpm, and what I've read about it 15-30 rpm is commonly mentioned as maximum speed for the thing. That was 5V and a ULN2003 driver; replacing that with MOSFET drivers should give you 20-30% more current already.

I don' t know if it's possible to go much over 30 rpm. The motor is geared down by almost 64x so that's almost 2,000 rpm for the stepper itself, or 1,000 steps per second. Maybe a stepper driver running at 12V or even higher?