@iratoric Cool. The idea of having units able and units unable to retreat is neat.
This is not really a request (because I believe you or the developers who will have to decide to accept this new feature probably don't want to go that complex at least initially), but in reality that would be mostly determined by the tactical speed of the units.
So, I'm throwing this idea as a possible future feature request (once a basic retreat system already exists).
One could have a "speed" unit option (defaulting to "movement" if absent) which determines if a unit can or cannot retreat based on what units are attacking, under the rule that all units with a speed equal or greater than the slowest attacking unit can retreat.
For example, if I have "transports", "battleships" and "destroyers", I could assign value of tactical speed of 1, 2 and 3 respectively. In this case, if I attack with only battleships a force of only transports and destroyers, the destroyers would be able defensively to retreat but not the transports (which would be left fighting alone if the destroyers retreat). In case of multiple forces, one could have (as written) the rule that for the attacker counts only the tactical speed of the unit with the lowest value, and that for the defender only the units with a value equal or greater than that can defensively retreat. For example, if I attack with battleships and destroyers a force of transports, battleships and destroyers, only battleships and destroyers can defensively retreat, but, if I attack with only destroyers (or after only destroyers are left in attack if I decide to remove all my battleships as casualties), then only the destroyers can defensively retreat (and, if they do so, the combat would proceed between the attacking destroyers and the defending transports and battleships).
Obviously, such a feature would also assure that movement 0 units cannot retreat unless there are movement 0 units in attack (normally impossible) which did not receive a "speed" greater than 0 in their attachments.
(Obviously, instead of transports, battleships and destroyers, they can be respectively corbitae, lembi and triremes or whatever.)