Oh, boy, I have done some of these too. You have to walk away now and then and just let your brain re-set itself! I usually get out of the house and walk the dog. A little cardio seems to help. But, then again, not at mid nite....
Good luck getting back to it.