The best time to deploy the anti-cavalry stakes is when the enemy has been creeping up your flanks with his cavalry. I timed it *perfectly* (total luck, tbh) in a multi-player game and the wall went up at the instant the cavalry hit and it wiped them out almost totally to just charge. I suppose the moral of the story is to keep an eye on the flanks and if you have no cavalry on the flanks, try light infantry to counter them if timed right.

Another dirty trick is to build a anti-cavalry wall BEHIND the sandbag wall and goad them into attacking... ;P