This often happens. I spend days, sometimes weeks, poking at some task, scribbling notes about it, and maybe one or two little flowcharts. I sort of fume at how little progress I'm making. I try working, and then find myself unable to find just the right music to work to, or unable to decide whether I should work before or after a nice afternoon's walk / trip to the gym / shvits in de sauna / whatever. I have to go thru at least one cycle of thinking that work can only be done in stretches of over two hours once every few days, to supposing that the best way to do it is to work at it for less than an hour, every day. As the process goes on, I may even start moving furniture around, or sitting around doing something odd like animatedly reading the orchestral score to Beethoven's Pastorale, or trying to make origami out of tin foil, or whatvever.
And then, finally, and I sit down and spend one day (or usually, night) programming; it's between six and sixteen hours programming at a stretch, and it's all done -- or near enough that the following few days are just straightforward stuff.
That's the way it happens. And it seems to catch me unawares each time.