This book is going to be really great.I might get such thoughts, also, dozens of times as I am writing, on any given day. It is also good to notice and acknowledge those thoughts, and move on. There is nothing harmful there, I couldn't repress them even if I wanted to, and they make me feel good. But what I am really aiming for is a total absorption in the work itself, not an ego trip about how good my work is. I have to keep my attention on the concrete problems I am trying to resolve, like "that paragraph doesn't quite belong there." The most useful thoughts are neither negative, nor positive, but pragmatically focussed on the actual work.
I am brilliant.
I am having a lot of good ideas today.
Boy, I like that sentence. I am a good writer.
Thomas Basbøll is going to really like this.
I still have it!
I could write dozens of books like this.
I've written a lot today, and it is good.
That is why "motivation" in either negative or positive senses is kind of misplaced. I can't be focussed primarily on a potential punishment (no tenure!) or a reward (distinguished professor!) as I'm writing. The motivation is in the focus on the work itself. The absorption. Without that it is impossible to do good work.