Well, here is the rough code I have so far. It achieves what I wanted it to do - large armies can stick together fairly easily without formations as long as they are in an open area, and it does reduce short range pathfinder use in those situations. However, there is still a problem, which is that units can get stuck against static obstructions. I think that may have something to do with the short range pathfinder being too optimistic about being able to walk around static obstacles when the navcells block the way (and the units have been bumped off the long range path by sliding). I'll still be tweaking it to see if I can solve that problem. Meanwhile please give it a try!
For the most part this is 2 changes. First, units slide against each other parallel to the path, as I mentioned above. Second, units move in an order determined by their long-range path length - units with shorter paths move first to make room for those behind them, who usually have longer paths.
A note - one interesting thing Starcraft II pathfinding does, is allow moving units to push stationary allied units out of the way. It might give a nice aesthetic to try that as well.
Another note - this patch is far from polished. "It compiles" is about what can be said for it! Please don't murder me over the coding style, which I'll clean up a bit before submitting on trac if I can fix the units-get-stuck problem.
sliding.diff