Before my alcoholism became full blown, I look back and wonder what I could have done to stop it before it reached the level it did. One main thing is that I wish I had seen a trained therapist who understands addiction.
I also think a good therapist in general would have helped, as I had many bad habits I wasn't aware I had, personal philosophies I was following which were damaging, and a general lack of guidance (which I still need).
Are you involved in any organizations such as church or volunteer groups? Just being around other people can help a lot with loneliness and boredom.