Looking back on this project, it hasn't gone as smoothly as I'd originally planned. And, much as I'd like to make excuses for that, it is my own fault. I was lucky to get a 2nd chance to prove myself, after screwing up my undergrad degree, and to some extent I've squandered it. I'm pulling things together now, and I hope that I can get things sorted out before the deadline - it's going to be close. But however it turns out (good or bad), it won't be as good as it could have been, if I'd been working this hard all the way along.
I think there is an optimum level of difficulty that suits me. At my old job (soon to be my new job), I could almost write the applications in my sleep, so I got bored. With this project, I've spent a lot of time floundering, because I didn't really know what I was supposed to do. I'm finally in the position that I can actually produce stuff, and I can feel the change - it's a lot easier to motivate myself. I think that's one reason I got distracted earlier in the summer - if it was a choice between going for a run and working on the project, I'd go for the run, since it was simple. Not easy, but I knew what I had to do.
Looking further ahead, some people have suggested that I should go to work for a research company as an alternative to a PhD. I'm now giving that much more serious thought, at least as an interim step. With this project, I've basically been left to my own devices - the supervisor asked me to come up with an idea for the project (which he approved), then pointed me at the relevant journals etc., and left me to get on with it. I assume that the same thing would apply in a PhD; I would be there to ease the supervisor's workload, not add to it. I don't know how it would work in a company - maybe it would be the same. But what I'd like is a more junior position, just for a little while, where someone else can tell me what to do until I get the hang of it.
Oh well, see what happens, I guess.