I can get into spells of this as well. What I try to do is to set high level goals (maybe 1-6 months out), break those goals down, and break those goals down, and really scope out the big things into a lot of small things. Only look at a day or week's worth of small things at a time (to not get overloaded in the quantity of small tasks). Set milestones at which you can assess your perfection, and if its not to your standards, revise your goals.