I've been playing guitar over forty years, and still suffer from tangents. Unless a person is really focused on what their doing, we all go through what your going through. I practice about five hours a day, and preform three to four nights a week. The band is always adding new songs to the play list and we write a lot of our own, so most of my pratice time it with new stuff. But I still like to run off down a different trail, just like today, and played about three hours worth of Lonnie Mack. I'm a decent lead player, and can fake what I don't know well. But if your still struggling with lessons, then Christoph is right when he says, "buckle down."
Your instructor is correct also. Split the time, do your lessons first, then jam. Do your work first, then play. You must get your basics down solid if you want to be good. You must know the scales and modes inside and out. It takes time and lots of hard work, just like everything else.
Now!!! Get off the computer and pick up your guitar and practice, practice, practice. I wanna hear you on a CD in two years. :)