I have given the advice "write when you write and edit when you edit" on several occassions. And this is advice that works for me. It isn't advice that works for everyone - there's very little writing advice that does.
In her excellent post "Three Things Necessary to Make Writing Good and Powerful" Yvonne Perry of "Writers in the Sky" discusses this, and how "right brained writers" and "left brained editors" and how they need each other. Her three points are also excellent and well worth reading. Go take a look.
The rest of her blog is good as well, so spend some time looking around. :-)