If you use panel switches to control blocks of track, this is a familiar problem. You come to the train room, turn on your power pack, and - surprise! A locomotive starts off down the layout unexpectedly, because you left a block switch engaged last time around. This can be a big hazard, as the locomotive can head off for big trouble before you can react to stop it.
Here is my solution: a modified form of “blue flag protection”. It consists of a vitamin pill bottle, a toggle switch, a blue LED, a 1K resistor, and a 9 volt battery. The switch just turns the LED on, that is all.
The concept is that the lit LED indicates a possible unsafe condition. When I begin operating, I turn the LED on and place the device at the exit of the train area. When finished operating, I see it on my way out; and the rule is that I cannot turn if off until all locomotives are secured - in other words, all panel switches set to neutral so any locomotives on the layout are disconnected from the power packs.
This ensures that on power-up next time, there will be no runaway trains.
(This is conventional cab control, using DPST switches controlling each block).