I get away from my computer when I find my mind wandering. I go to the store, take a walk or go for a drive. Even visiting friends can help, just talk about nonsense things. Try to get your mind off of writing for a while.
Scrubbing the tub or shower seems to help get out some aggressions, even baking bread. I find that if I do something with my hands, my mind is free to wander and then the ideas come. If you are working on a particular piece and find yourself stumped, go to another. Just save your work until you can come back to it.
Hope this helps, even a little bit!