Brian, I did pretty much the same thing when I was in school -- doing fine on classwork and generally As on tests, but just could not seem to pull it together to do homework until I was a high school senior. It was too late to help me much, but it did show me how much better I liked school when I did well in it (plus I had changed schools) and how I had really been messing myself up, and I did much better in college.

Instead of beating yourself up now, why not take things a day at a time? You can write down the assignments and bring home the materials for one day's homework, right? And if you can do it for one day, you can do it for the next day, and if you mess up, you start over again. I know you're bright enough to do the work from seeing you on here for so long, and you really do limit your own opportunities by sabotaging yourself like that.