I do the same thing. I really get into playing for a few months and then I lose interest, take long breaks for weeks, or even months, at a time in order to enjoy other pastimes while the urge starts building again.

I've found it very helpful to deactivate my accounts immediately after activating them. That way I don't run the risk of giving Blizzard extra money for months I decide not to play. I don't even want to think about how much unplayed money I've given Blizz in the past before I started doing that.