I've had similar experiences in my past and just like you, isolation turned me quite asocial. Also my schedule drifted to its natural cycle and spent a lot of time staying up and was quite productive and enjoyed my own company but the cost was too much to bear. I noticed that I was becoming savage around people in the sense that I didn't know how to connect anymore. Fast forward 10 years and am married, have a child and fit into a normal schedule; am feeling quite healthy mentally, though I feel I don't get enough time just being by myself. If I had the chance to change anything in the past though, I would leave things as they are. I that feel I grew in some respects while being alone/lonely. I did not pray but I did my type of meditation which is painting.
I've been watching a foreign documentary about isolated people, people who live in abandoned villages and have few or no neighbors or people who live in very inaccessible places and every single one of them were talking about god and praying and their painful loneliness.