It just so happens that sleep deprivation is an uncommonly effective temporary treatment for depression, which the author states they were suffering from (“extremely”) at the time they had their formative experience. I suspect that is all that is happening here.
I used to spend the nights wandering around and exploring the woods in the pitch black, found it incredibly soothing and calming to my depressed mind.