Anne R. Allen has a though-provoking post on writing and depression. I always question the notion that writing causes depression--I think a lot of people who go through hard times write as a coping mechanism, so they can be correlated without the former causing the latter. Also writing requires solitude, and a lack of social connections is correlated with depression, and then if you throw in how impossible it's become to succeed in traditional publishing.... But I will admit that I probably do my best world building when I'm a little bored, somewhat isolated, and not terribly happy.