Damn, that's a problem I've always wished I had. I write too, but not much. I find that writing and coding to be very different activities, at least for me, so I'm not sure you could channel that energy into coding. From the sound of it, your writing compulsion sounds like it is more a matter of putting down your thoughts rather than creating something, that is, its not very cerebral. Coding, requires a filter between you and the keyboard, so this sounds like it would be a major stopper.
It does sound like you could make a nice political columnist/author: something like Limbaugh or Franken.