There is a lot here I can relate to. I have something of a mildly bipolar relationship with writing; sometimes the juices are flowing, and sometimes everything seems so futile. I try to take advantage the first frame of mind, and identify the other so I can do something else instead.
Today is a good example: earlier this summer you had posted a "sci-fi speed-writing challenge" that I had an idea for, but I had just started the story for Camelon's contest and couldn't afford to get distracted. So even though no one submitted anything for that challenge… yesterday I had an opportunity to devote a block of time to cranking out some words, and indeed I got through 8000 words on a new storygame before the brain cells stopped firing around 11 PM. I'm here now because I have all night to burn through a few more hours of writing… but after looking at the same page for over an hour and only coming up with a few paragraphs, I realized it wasn't happening. I'll probably read for a while instead.
Certainly, having a regular sleep cycle is helpful. Yeah, sure, there are nights when I'm up to 4 AM working on something, but that's not anything I could sustain. I see those as one-off events, where I have the motivation and energy to keep going until I'm done. Then it takes me a day or two to recover. But I absolutely feel more imaginative and productive if I've been sleeping reasonably well.
My employer would love it if I could crank out lots of overtime like everyone else I work with, but I know from experience that I'd be useless to everybody after just a few hours. Currently I give them a solid 8 hours, and then I have to insist on moving on. Otherwise I'd burn myself out, feeling depleted during the day with nothing left over for my free time.
And more than once I have soured on things I used to enjoy writing about. For example, I used to keep a detailed journal of my outdoor trips for about 12 years. I enjoyed doing it, right up until the day I didn't. Nothing changed, except that I got bored with the idea and the weekly writing became a chore I had to force myself to do. So rather than forcing it, I moved onto something else (...which isn't intended as encouragement to quit whatever you're working on, just that the inability to focus on a project might itself be telling you something).