Well, due to their eye placement, donkeys can see all 4 feet, and so know where they are stepping. Additionally, because of their eye placement, the canyon wall a few feet away discomforts them more than the empty space, so they tend to walk towards the edge. That's nothing to do with messing with their riders, and everything to do with their visual system.
Now, dangling a hoof and looking the rider may be having a bit of fun, or just making sure this meatbag isn't going to do anything inconvenient. On my ride into the canyon, the guide told us of the time one of the turons fainted, and how he had to dive off his mount, move past all the other animals, and get to the subject before she fell out of the saddle.