The first and biggest tip for learning anything on the guitar, is to start doing it SLOWLY. Make whatever motion you need to do in slow motion, slow enough that you cannot help but do it right, every time. Next, do it a bazillion times, gradually getting faster. Use a metronome, and start off at 60 bpm (or slower!) and take FOUR CLICKS to complete your motion. Do that for a few minutes every day; after a few days, try doing your motion over two clicks. If you can do it flawlessly, do it at that speed for a few days, and then try doing it in a single click. If you have trouble, slow it back down for a day or two. Once you're making your motion in one click at 60 bpm flawlessly for a few days, speed up to 80bpm, then 100. Then back to 60, but do it in half a click. You will soon find yourself at performance speed, and you'll do it flawlessly every time.
A trick for staying on the right string is to remove pressure from the finger, but keep it in slight contact with the string when you're making a large move on the fretboard. You'll have to watch out for "finger squeak", but if you start slow and gradually build up, you'll soon find that you can lose contact with the string, but still wind up in the right position at the end.
The idea is to train the muscles in the fingers, hand and arm to make exactly the same motion each time; trouble is, it's just as easy to teach them to do it wrong as it is to do it right. That's why you have to start slow enough to do it perfectly EVERY TIME.
Remember, practice doesn't make perfect. PERFECT PRACTICE makes perfect.
"There's such a fine line between genius and stupidity."
--David St. Hubbins