During the Napoleonic wars, at least, troops would be trained to move in square formation, albeit at a slower pace. Remember the Battle of the Pyramids, where divisional squares (!!!) were able to move. Later battles well into the HWLG period also provide some instances.
Whether or not troops in square should be able to move gets debated in wargame circles a lot. I've seen descriptions of squares moving but nothing from personal accounts. This is why I don't complain about it in the game. The opinions range from totally unmovable squares to squares that can move at normal speeds or even run, and at least one description mentions a running square.
There are some people who believe that the hollow square used to defend against cavalry was unmovable, while there was another formation more like troops in attack columns that was often called a square, I believe it's called "open square", that was able to move. It gives considerable protection against cavalry attack, but has very little firepower.
While it's conceivable that a troops in a square formation could modify their formation a bit so that they could march (they can't possibly march if they're maintaining the actual square, and it's not because of facing but because of the amount of ground each man takes up... if they're moving it's a different shape than if they're in square). If they're not maintaining the square formation proper, then if they're threatened by cavalry they have a chance of being unable to form square. Now, they're obviously already in a formation very close to square so it won't take long to form, but they are not actually in square.
Because of the above, I'd put a lot of restrictions on squares moving at all. It would require higher quality troops with good morale, for example. If they tried to move and were charged by cavalry, they'd have to take a morale test to reform square (which would make them stop) and then have an additional die roll to see if they formed square even if they passed the morale check. Most of the time the infantry would be successful. But if you could control whether or not they attempted to move, how much risk would you be willing to take? If cavalry catches them unformed, as they would be in this case, they're at a severe disadvantage.
Actually, if I'd written the game, squares wouldn't be able to move. If enough people complained, I'd implement the above rules.
Hook