Easy. First, when a vehicle gets out of the station, or if the alarm rings, then put the lights to red. Setting a a list of actions to do with a time of like... let's say 15.f or something would make it go green afterwise. 
Then you can do it and send it to me smart@..

You can make it easier with a trigger in fornt of a station gate 
I was thinking of something like this to, although tieing it to the alarm sounds a little bit better game wise as this would be more likley to give the engines a clear path in front of the station because if we rely on trigger, the engine(s) will already be leaving the bay so there ma be traffic in front of the station although its fairly dead by station 1.