Are you programing in a high level language or assembly? I would think your application could be done in a high level language and it would still be fast enough. I use Microchip PIC Basic a lot, but I think it's restricted to the Microchip line of microcontrollers. I would assume other microcontrollers have similar high level languages. Having said that, I'm no expert and someone much more experienced may step in and school me.
Here's something I made years ago that is driven by servos and accepts input from a button.
A few things to note:
1. If you're doing the opening in just 1 pulse and the closing in just one pulse, I would think you could get a better result by slowing it down slightly and sending the servo several incremented delayed pulses to get to the open position and the close position more gradually. So send first position pulse, wait 100 milliseconds, send the 2nd position pulse, etc.
2. Assuming we're in a high level language, loops and variables are going to be helpful. If we don't want it to be doing something, send it into a different loop until we do want something to be happening, like checking the input. If we want to know how many times something has happened, we increment a variable.
Let's do some pseudo code to work through the logic of it.
We need to first know if the gate lamp is in a flashing condition. That's going to determine everything. If it's flashing, the gate needs to be open, if not, the gate needs to be closed, right? So how do we know it's flashing and didn't just come on once randomly during attract mode? I would think it's a matter of timing and checking that it came on, went off, and came on again within a certain amount of time. That amount of time is the same amount of time we'd use to tell if the flashing has stopped. If the lamp goes off, we want to know that it's completely off for a certain amount of time before we close the gate or we risk closing it in the middle of a blinking sequence.
Timer_Variable as integer
Blink_Variable as integer
Initialize Loop: (initializes variables and sets gate to closed)
Timer_Variable = 0
Blink_Variable =0
Send Gate into Closed position (Pulse Out 1?)
Turn Torches On
Go to Blink Check Loop
Blink Check Loop: (Checks if lamp is blinking over the course of 1000 timer intervals and opens gate if so, if not it initializes variables and starts the check over - Adjust timer variable as needed )
If Input is high then Blink_Variable +1
Timer_Variable +1
If Timer_Variable = 1000 and Blink_Variable > 2 then go to Open Gate Loop.
If Timer_Variable > 1000 then Timer_Variable=0 and Blink_Variable=0
Go to Blink Check Loop
Open Gate Loop: (adjust accordingly for timing and whatever your final pulse position is)
Pulse Out 1.2
Pause 100
Pulse Out 1.4
Pause 100
Pulse Out 1.6
Pause 100
Pulse Out 1.8
Pause 100
Pulse Out 2.0
Blink_Variable=0
Go to Blink Stop Check Loop
Blink Stop Check Loop: (Checks if blinking has stopped over 1000 timer intervals. If so, the gate closes, if not the variables are initialized and the check starts over. Adjust timer as needed.)
If Input is high then Blink_Variable +1
Timer_Variable +1
If Timer_Variable = 1000 and Blink_Variable = 0 then go to Close Gate Loop.
If Timer_Variable > 1000 then Timer_Variable=0 and Blink_Variable=0
Go to Blink Stop Check Loop
Close Gate Loop: (closes gate and sets the program back into the initialize loop to start everything over)
Pulse Out 1.8
Pause 100
Pulse Out 1.6
Pause 100
Pulse Out 1.4
Pause 100
Pulse Out 1.2
Pause 100
Pulse Out 1.0
Go to Initialize Loop