One of the most effective things you can do is become a virtual smoker. Smokers get an urge and step out for a cigarette every hour - or every time they get stuck.
I don't smoke (never have) but I am trying to emulate that; the most effective way to solve a problem is to step out and do nothing for about 5 minutes. Take a walk. Look at the trees. Anything. Then when I come back I have either solved the problem or decided to leave it with a hacked together patch and work on something else; Ill probably still resolve the hack sometime later.
The opposite is to seek out some distraction, click around on facebook or HN or something - you solve nothing but spend lots of time....