I do the same thing on a regular basis, and I think the same "blacking out" thing happens to me (unless you literally blacked out), but I wouldn't really describe it as blacking out. It's more like day-dreaming - I end up in a mental state where there's nothing but what I'm looking at / thinking about. Very "visually" vivid, but hard to describe, and when I come out of it some amount of time has passed (5 to 15 minutes), and I'll have no clue what happened in my surroundings during that time.
It has been useful for visualizing overarching design - if I know what an unwritten application needs to do I might visualize how the "parts" should fit together (not in any magic sense, just faster than I would without being in that state). Sometimes it's good for solving logic problems, riddles, etc.
Sometimes it's not good for anything at all. Most of the time that it is really useful, it's by coincidence.
It's not a physically draining thing for me at all, just a bit disorienting.
I assumed it was probably a good idea to never do that again, but I have a incredibly detailed memory of what I pictured so there is a pull to try it again. My point is I think you can overstress your mind and like overclocking a CPU it becomes less stable as you do so. Our minds are a complex balance of chemical signals which has real limits. I try to get enough sleep and take care of the wetware because I think it's less stable than you might assume. Rest and good food are the basics, but so is balancing how you use your mind and trying to avoid unbalanced behavior.
I have gone all out 12 hour days for long periods, but they seem to lead directly to burnout and depression. Yet, if I don't work really hard after a few months I start feeling useless and slow, so I don't think steady state is the best long term idea. My guess is finding a good cycle where I avoid burn out and feeling useless for long periods but I have periods of extreme activity and rest is my best long term balance. However, I have no idea how this relates to my inner biochemistry.