Let me offer a bit of context:
"Merciful Trains" is my first (attempted) mod. The goal is to make the train brake to a stop if somebody is in the way (like a car stopping for you when you cross the road). The issue with setting Manual mode is that the train could stop anywhere, and inserters/pumps will pull out of the wagons and cause havoc.
You could spam speed = 0 on_tick, but it's ... quite horrible to behold.
My final approach was to wipe the train timetable. This stops the train dead, so you do it at the end of the deceleration curve, and it keeps the train in Automatic. (And then you need to put the timetable back when it's appropriate.)
Then I discovered Splatter Guard exists and I feel like its approach of using teleports is a lot more practical. It's quite difficult to get trains to brake reliably when so many modded trains travel faster-than-light. So I didn't publish that one.