I usually wait until (A) something is painful and (B) I have enough instances of that pain to see the pattern that my refactor/abstraction will address/consolidate.
Else I'm just rearranging furniture or making it harder to rearrange in the future because my assumptions were wrong -- I've built a fridge and stove in a room that never became the kitchen when I could've just fetched a bucket of ice and a bunsen burner as I needed them. But now all the doors are too small to migrate my appliances because I thought this was going to be a hobbit house. Turns out the guests are only half hobbit.
It's easier to refactor naive, repetitive, even dirty code than it is to refactor failed and premature refactors/abstractions.
Seeking correctness is cool, but often I can't see far enough ahead to know what "correct" actually entails. Writing what feels like a simple/obvious hack now can be better down the road than trying to prematurely engineer something that seems correct.
Don't know if you have seen http://railscasts.com yet. But it really helped me.
One thing I've been having trouble with as my project gets more complex is when to refactor. I guess I'm not yet at the stage where I can accurately judge the benefits of refactoring a code vs. the cost. To use an analogy, am I just re-arranging the furniture to change the look-and-feel of the room (superficial), or am I actually making it easier for the guests to make themselves comfortable (real benefit)? I've read books like Pragmatic Programming [1] that advise refactoring whenever possible to avoid technical debt build-up. But it seems to be that there are times when working on a new feature would result in more value-add for the project as a whole.
Another thing is motivating myself to write test cases. The Hartl tutorial taught TDD, but when I started my project from scratch I quickly realized that TDD would slow down my progress significantly, and I didn't yet have enough experience to assess how a feature should work to be able to write tests for it. This did bite me in the ass just last night though, as I spent three hours troubleshooting a bug that a test case would have caught. Oh well, live and learn, right? :)