Winged scapula - Serratus work doing push-up position on a ball with protraction and retraction.
This is ONE exercise that has a good use, BUT, there are many muscles that stabilize the scapulae (lower trap, rhomboids, etc) and they are often weakened by tight muscles that attach on the opposing side (pec minor, pec major, lats, etc). The answer to your question is performing the necessary flexibility and then the appropriate stabilization exercises. Stabilization can come from some more isolated movements, such as the one you described in your question, but ultimately those muscles must learn to work in an integrated fashion with the rest of the body. Thus the key is proper flexibility and stabilization training exercises that requires the shoulder girdle to stabilize itself during functional activities or movements. That means movement in all planes of motion and using all muscle actions (eccentric, isometric and concentric) at various speed of repetition. Start with slow reps, emphasizing eccentric and isometric muscle action and progress to faster rep speeds. I could list many exercises, but my suggestion is to invest in some videos that will provide a lot of exercises and show you the proper techniques. Try the Integrated Strength Training and Integrated Core Stabilization Training videos from the National Academy of Sports Medicine.