Yup, I'm aware of this behaviour and it's time to make a choice. The ground effect lighting is built-in to Trainz and will by default light up the ground in front of the loco whenever the headlight is turned on regardless of the direction of travel. The only way to get the ground lighting to switch ends is for the operator to change the active cab i.e. go into cab view then use Alt+C to switch to the other end. I don't know a way of making this happen from the loco script.
For my own locos I disable the ground effect lighting and just us the directional coronas.
So the choices are:
1. Have the ground effect lighting and only switch the marker, headlights and tail lights when the driver changes cabs, or
2. Have the marker, headlights and tail lights switch automatically based on the direction of travel but do without the ground lighting effect.
Which do folks prefer?
Cheers
Dave