give each train the command at any point where you set a trigger to continue until a certain train passes another trigger
Transport Tycoon /Locomotion had a similar function. You could set "Priority" levels for each train. It worked to some extent, but if you had a low priority train attempting to cross or merge onto a track with a lot of high priority traffic, they could get stuck there for really long periods of time. Still, TpF would benefit from the mechanic if tweaked to fit.
I have numerous places I could use just such a tool.