It's appropriate that Socrates called writing a pharmakon--a drug. (His reasons, by the way, are complex and interesting... run out and read Plato's Phaedo for the lowdown.) That's how I treat it, like a drug, both addictive and curative. When I'm not writing, I despair. When I am writing, I'm on top of the world. I don't know if writing pushes aside unhappiness or if not writing creates it.
There are plenty of other writers who talk about the link between not writing and depression. Ramsey Campbell (personal hero) said it particularly well. I can't remember the name of the story and I'm going to butcher the quote, but he said something like "Writing is what I do so as not to face the depression of not writing." And that's it, exactly. I write so I don't have to live with the downer of not doing it.
Does that make me an addict? Yep. Should I seek a 12-step support group? Hmmmn. I think I'll just join the HWA.
But one other thing about this pharmakon called writing: much like marijuana, it's a gateway drug. It opens the doors to multiple substance abuses. Some people take it too far (Stephen King himself turned to cocaine once, and Hemingway was a notorious alcoholic), but most of us keep a handle on the addictive substances, limiting ourselves to the trifecta of caffeine, fat and sugar. Me? I'm nursing a cup of tea as I type, and there's a cup of cocoa waiting for me right after I tuck the kid into bed.