Whatever you’re doing, drop it.
If inspiration or motivation hits, use it right away, if what you’re being inspired to do is more important. You just sat down to listen to an ebook and a flash of inspiration hits to do some writing, do the writing. The book will still be there, the words may not be.
Of course, habits trump one off inspirational spurts in the long run but why should you let it go to waste?
My habit is 300 words a day for a book I’m working on, if I miss a day, I make up for it the next or the one after, never letting more than two days pass without writing. One day, I wrote almost 7,000 words. I could have taken three weeks off, but I didn’t, I was back at it the next day.
Make hay when the sun is shining.