Help with my project for garage door arduino

Thanks PaulS for the advice about names, I will change that.
This is my first project with arduino. I was playing a little with it but nothing special.
All limit switches are made by simple button tutorial just like you said with pullup resistor.
I can make to open a doorA until limit switch is pressed, but I dont want to wait to open one wing to the end and then another.
How to make a function for exemple:

start to open wingA
Until limit switchA
Delay 3 sec
Start to open wingB
Until limit switchB