Yeah, I hate to repeat it, but "just write it down" seems pretty sensible to me. When I've gotten ideas midstream for how to continue a long thing I was in the middle of writing, I've been known to start a list of quick notes at the bottom of the file and "push" it down as I keep typing, deleting things as I get to them.
I just noticed how much effort I put into remembering what I was thinking-- I do a lot of "I had an interesting idea about that which I wanted to include-- what was the idea?".
It can take at least 3 or 4 repetitions before the idea finally gets typed out, partly because I might be typing or formulating something else and then want to get back to an earlier idea.
I'd be amazed if I were the only person here with this problem. Any suggestions? Does dual n-back help?