Shuffeling is really absurd - I have seen a unit shuffeling off the city square. Of course, once it was off, it imedeately routed I had won.
But I read a very easy way to stop shuffeling here in this forum: When a Phalanx starts to move to the right, hit stop. They will sthen just stand still and fight as they should. It needs to be done only once per fight.
I have forgoten who has posted it first, so I cannot give him proper credits, but it works like a charm.