This was actually done in Age of Empires 3, where ranged units in melee range would hit things with their weapons instead of shooting them.
Musketeers had muskets with bayonets on them, so they did quite well in melee. In the other hand, skirmishers armed with rifles were forced to hit things with their rifles when caught in melee, which was obviously ineffective.
It was not only cute, but it was also realistic and it balanced out ranged units caught in melee fights.
I mentioned this before in another thread, however I'll say it again. All infantry and cavalry units which were attacking buildings did so by torching the building, NOT by using their weapon. This was also more realistic and it looked better. Even melee units had a ranged attack for siege which was simulated by throwing the torch. Very nice overall.
If these kinds of animations could be included in 0 AD, I would love it. It should be doable without too much technical difficulties as far as I know, however it would represent some tedious work. So I agree with you,DMDonahue. However, that is one task that needs to be looked among many, many more.