Over the years I've come to realize that what once felt like procrastination is actually my brain working out the solution to a problem, and it quite literally prevents me from reducing the solution to code until it's damned well ready for me to do. So I just go with it now. The only thing that seems to speed this process up is intense cardiovascular exercise, which is probably a good idea on its own anyway (but I imagine it seems awfully odd from the outside).
As for ADHD, I probably have a little of that going on with a sprinkling of Aspberger symptoms, but not seemingly in a sufficient way to have any significant effect on my life and/or overall productivity (except that is when it comes to %$!^ing daily scrum updates which drive me bonkers - once a week would be fine, once a day is ridiculous).
Today I spent 5 hours staring at, stepping through some callback-heavy code, reading HN, browsing the web and about an hour to write, test and deploy about 20 lines of code fixing a really nasty race condition. And I'm still not completely sure things are really fixed. I might have spent even longer had it not become apparent that we have just the two options:
1. band-aid around the problem
2. complete rewrite of a large portion of the website