If there's any way you can help it I'd avoid very long stretches -- at a certain point you begin working against yourself, and create more bugs and problems than a solid solution. Of course if you need it done, you need it done, and it can't always be avoided especially in an early stage startup when you're starving for resources/time/cash, but if you want to become a sustainable business and predictably better programmer, quoting out and allocating the proper amount of time when planning the project is well worth it.
Of the times I've done many of these long coding stretches (and that is many, many times), I paid for it later physically (illnesses/burnout), and often the code ended up having to be completely replaced or significantly repaired later -- even more time is burned in the fixing than in the initial creation.
In my mind these days, long stretch coding is what builds technical debt. Something you code in smaller chunks ends up being more inherently understandable as you are forced to leave and return and each time and be able to pick up and understand what has been done and what needs doing. When you do a long stretch, it's all in your head, and that means that when you come back to fix it you might need a long stretch just to have enough time to understand what you even did.
Hope that helps!