Gatlings and Machine Guns are pretty good at creating choke points and protecting your flanks. Put them on a hill, even better if it has a fort or a citadel. They have a relatively high defense for the era, so they don't take that much damage, and they can still take a shot at everything that ends next to them, and a few strategically placed are as effective at slowing down a counter attack as the Great Wall. They're not great on offense, but they were not really used for that, except in colonial wars against technologically backwards opponents.