Flip between motors each time circuit energized
You need circuit, that has two parts: 
1. H bridge to be able run motor in both directions. I will not go to details about that, Mr. Google knows all about it, just ask him.
2. "Button with memory"
You have timer, which closes circuit, just like a button. I'm a simple person, I like simple things, I will speak like it is a button.
You need different initial conditions when this button is pressed. In fact you have different conditions alredy, you just need to take advantage of it. One condition is with doors closed, the other with doors open.
I would suggest using relays to implement it. To detect initial condition, there are many possibilities, one of them is magnet and reed relay. Place magnet on the top of doors and place reed relay in position, that matches with magnet when doors are open, or closed, whichever fits you better.
You need two additional relays to remember initial condition after doors will start moving and that's it. You have signal direction signal, which you will use as input for H bridge.