I always sleep on it. I'll create a nice riff or melody or passage, make sure I remember it, then leave it for a day or two thinking about how you'd like the song to progress and then, when you go back to writing the rest of the song, it should flow a bit easier.
It's called 'visualisation'. I use it a lot for learning how to play tricky or fast passages. I'll learn the notes, then i'll sit down and imagine myself playing the piece perfectly. And save for a few mistakes, I'll feel alot more confident with it when I come to play it the next day for real.
Just imagine yourself playing this song you're writing, and it'll come.
But don't let your mind wander!
Truckstop