I know this will make me sound like an asshole, but I used to make shots like that all the time. They're actually easier than shots which involve long runs at high angles, because the right angles of the table help set things up. I spent an entire year in college doing nothing other than smoking weed 24-7 and playing pool. (There was a pool table across the hall from my dorm room.) Shots like that would surprise the guys who saw them, but they are not that hard, if you practice. You just line up the shot, put some spin on the cue ball depending on where you want it to end up, and just clip the ball against the rail. That year, if I got to shoot after the break, the other guy was done. I attribute it to constant practice, and a very good sense of spatial orientation (left-handedness).
Unfortunately, it only stays with practice. I played in a bar a couple of years after that and got my ass handed to me.