Contrary to this blog's title, marathon coding, or Restless C#ding as I call it, does not always yield the most fruitful results. During a critical point in development, it's sometimes more helpful to force yourself to walk away from a problem occuring on the tail end of a session that is dragging late into the non-work day.
Code quality will doubtlessly improve, and your mind will have a much simpler time trying to analyze and solve problems. I'd read articles about the uninterrupted time (I really wish I had saved the article) needed to concentrate to get into the so-called "Zone", a career- and industry-agnostic state of mind (characterized by a higher concentration of alpha activity in brain patterns) under which the mind is more focused and more apt to achieve that with which it has been tasked.
What is a harder thing to quantify is the morale toll that taking a step away from a task will have. At least for myself, I enjoy the gratification of seeing newly working parts of an app after a long session of difficult concentration, logic, and code. Denying that pleasure for the sake of quality can be a hard pill to swallow. On the flip side, there are health benefits as well, as the body is much more productive having regular rest cycles.