Most good ideas I have surface after a break from coding, be it a walk, weekend, or night of sleep. Those ideas start depleting as soon my hands hit the keyboard, and once they're gone I enter full code monkey mode. When I'm conscious this transformation is taking place I usually hit up pen and paper or a white board, which can buy me extra hours. It probably comes out to about 50% of time planning, 50% coding, and as long as I don't spend too much time in the latter I can avoid getting burnt out. I figure if I have to try when coding I'm doing something wrong though it's sometimes unavoidable.