My strategy in those situations is to get out my phone, set a timer and say: "I'm going to work on x for five minutes, if I still feel crappy after five minutes I'll stop." That mental bargaining is bizarre in that I know its irrational but it always works, five minutes is enough for me to get enough 'creative inertia'.
Making things isn't a panacea for me, when I'm done working I'll still sometimes feel less than great, but it always helps.