With most characters in Brawl, you can just tilt at the right time, directly in the opposite direction that you are running (in this case, the edge) and grab the ledge free of lag when you run off the stage.
Some characters however, including Wolf, cannot.
Instead you have to run off the edge and immediately as you clear the lip, rotate the stick in a clean half circle, to the opposite direction. The difference between the two is that in the other, easier version, one may just tilt in the opposite direction- as opposed to in this one, where you must rotate from the initial direction to the desired, hitting all degrees on the way. think of it as a compass.
if you are headed right off of the stage;
tilt east > tilt southeast > tilt south > tilt southwest > tilt west.
you'll grab the ledge every time. Be careful though, if you fail it, you will most likely fastfall and die.
for this and all ledge techs, try making a level that has a nice long floor, with a platform of regular blocks floating above the stage, then when you fail it you dont die. I made a level for wolf and falcon, just to practice without having to wait for falls and respawn.