Support ability to dynamically change train consist via unit detachment, shunting, sidings.
Initially, this could be for the most basic ability of having a power-unit detach, run around and reattach to the other side of the unit. With the addition of a turntable, you could rotate single-header power units.
Taken to its fullest extent, you could have sidings that can be designated for specific wagon types (empty) and/or sidings for explicit cargo units. Then a train could reverse into these sidings to 'build up' the defined consist.
Generally, with the addition of waypoint like tracks for siding, yard, shunt-head, and a special 'idle-line' this is achievable by having an order to on a train to Detach (x front units) and make them a new unit (Line1 > Line2-shunt). The shunt orders then are part of Line2-shunt - move to, attach y units (removes those units from their existing line), use turntable, etc. Finally, the last order to transfer the consist to a different line (line3).
Train Shunting
Advanced shunting logic would be a fantastic logistical option to have. Perhaps there should be both a simple set of shunting rules, as well as a basic scripting interface to allow players to program their shunting rules? (Extending this to train logic in general would be interesting, too.)
The goal of this would be to allow very nuanced logic, without bloating the UI with a hundred options and eating into dev time - and still having a simpler interface for people that just do *not* want to have to deal with programming. An example of such logic is "If [x] wagon is full of [y], and Station F is empty, connect it to [shunt B]. Else, connect it to [shunt A]"
While I have my own idea for shunting implementation, OP's implementation seems more refined and effective. My simpler/cruder approach boils down to: Allow trains to disconnect rolling stock at a stop. If a stop has rolling stock, block any trains from arriving *unless* they explicitly have "connect rolling stock" in their schedule