I've been there, more than once. I would suggest not coming home from work (unless it's just to change), and going to a coffeeshop with your laptop. If need be, get a small cup of coffee or some tea with caffeine. Set a very modest code-related goal for yourself, and don't let yourself leave until you achieved it. IMO just being out of the house in the presence of people helps when in such a funk.
I agree with the idea of going anywhere other than home to free yourself of any distractions. However, my shifts are all over the place and I often finish work at times when coffee shops and most fast food joints are closed. Although they are standard 7.5 hour shifts with an hour long break, the hours I start/finish can vary greatly week to week. Is there a way to code on an iPad or a cheap Android tablet? I haven't used my laptop in a while, and I wouldn't exactly trust myself to bring it to the workplace lest it gets stolen. At least with a tablet I could keep it in a bag small enough to fit in my locker while I'm at work. I can't have my bag with me at my desk in the workplace because data protection policies, and the only other place to store it is in a shared cupboard where it might get stolen.