In addition to the above, a preposterous, possibly toxic, amount of caffeine has aided me immensely in the past.
When I write, it is not typically fanfiction. I think a large part of "writer's block" is self-limitation, which comes from only writing about a certain subject or in a certain story or too long at a stretch; Eventually you run out of ideas that you can easily connect without mental fatigue, which is why from my early writing career I have a lot of brilliant would-be novels that halted somewhere between one-fifty and three hundred pages (12p Times Roman single-spaced standard formatting). What I found combats this is always having something else handy that you can work on. That's really the only trick. If you stop writing you grow complacent; There was a time three months ago when I was writing ten [quality] pages a night whilst still maintaining my daily schedule and fooling about online, then if I eschewed sleep I could get up to about twenty pages in a night... Then because of real-life issues I couldn't find inspiration anymore, all but stopped, and now I'm having trouble regaining my momentum. The trick, then, I surmise, is to never actually stop writing, even if it means starting/adding to another piece.
Also coffee. And insomnia, natural insomnia helps the coffee do its job.