Even if you do have the self-discipline to go back and write the comments (and don’t fool yourself: you probably don’t), the comments won’t be very good. By this time in the process, you have checked out mentally. In your mind, this piece of code is done; you are eager to move on to your next project.
This is exactly what i am like with my research projects; thus i should be writing the manuscript constantly as i'm doing the project, and submit it when i'm done.. Using latex is probably best way for this; since then any figures i make along the way i can easily just import into my document without much effort. Thus gives a 'written version' of the code / outcomes from running the code.
i'm also guilty of this when writing code tests :s. So again, this should be done as i go.