I think distraction is important. Not least of all distraction is a stress relief tool, it keeps us sane, rational and level; able to think things through from a more realistic perspective because we've been away from the problem. Most of the things we need to focus on are taxing on some level, the more effort we put in, the more our thought processes are made ever increasingly task-centric. It's important for us to shut out the periphery and dedicate as much of our cognitive ability to what we're doing as is needed and we gear ourselves up to think in the appropriate way for the job. This has it's dangers, they may be subtle, but the more one small thing becomes your reference point for dealing with the world - even if the task is relatively trivial - the less suitable our frame of mind is for other things, and the further off balance it will become. Distraction is how we reset, restore normality and centre our cognitive processes. We are adaptive creatures; while it's our greatest strength, over-specialisation, even in a transient sense such as your current state of mind, is detrimental on the broader scale.
This is exactly why leaving a problem and coming back to it later can be a catalyst for success. Looking at it 'afresh' is looking at it without the bias you had built up by prolonged consideration before. Other options are weighed more rationally and you are more open to alternative ideas.
Of course there's a flipside to this coin. Distraction itself can overpower the creative process, taking precedent and dominating your time. If you are too distracted you lose focus, lose your drive to continue and to make a success of your task. Too much distraction is destructive; as much as we need it we can become dependant, procrastinating, putting-off, delaying.
It's a balancing act that I doubt anyone ever truly masters, but next time you're stumped and not making any progress: stop and find yourself a distraction. Not for too long though, eh?