My guess is once you get this girl out of your life, you'll feel better. Granted, you'll feel worse for a while, but in the long run it's best. I tried to be "best friends" with my first serious girlfriend (nearly 3 years) and in the end, all I did was torture myself and keep myself from moving on while she could not have possibly given a shit less about me. Like you I was lonely and miserable and trying to figure out what kind of relationship I could have with her, doing a lot of drugs, drinking, etc and once I manned up and got her out of my life I did worse for about a month but then I started to see it was the best thing to do for myself.

As for drugs I can't really say too much but I do think that not all use is abuse. I use opiates too, but it harms NOTHING in my life, and I'm not just in denial. I mean seriously, there are people that drink 2 or 3 beers every night after work and it's OK because it helps them "relax", but I'm an addict because I take a pill or 2 a couple times a week? I don't see the difference, honestly. I can't advocate street drugs, though, because you have NO real idea what's in that shit. At least stuff that comes from a pharmacy is regulated.

Also take some time off from school if you just can't seem to get your shit together right now. My brother did that, he went through a period in his life where he had girl problems, health problems, job problems, his life just blew, so he took a year and a half off and it was the best thing he could have ever done.