Bonnie is 14 years old and I've owned her for just about 6 months. She was the dictionary definition of a drunken sailor and it drove me crazy. It's taken a lot of work and constant attention to keep her on the path. She's gotten much better - it just took consistency.
What still gets me concerned is when we are on a narrow path with a steep drop off on one side; she will walk very close to the wrong side and I've got to keep my aids on her.
Lean your body slightly (just enough to shift your center of gravity) to the outside, you know that side where the long fall exists. Our natural reaction is to lean away from danger but this causes your horse problems. He now has to adjust his weight the other direction to counter balance you, aka closer to the edge. So you go against your natural instincts and lean into the danger so your horse has to go away from the danger to counter balance you.
OR, just force yourself to stay centered in the saddle and not lean away from danger.