Bob Dylan rambles about changing keys while writing:
When you sit down to write a song, do you pick a key first that will fit the song? Or do you change keys while writing?
Yeah. Yeah. Maybe in the middle of the thing.
There are ways you can get out of whatever you’ve gotten into. You want to get out of it. It’s bad enough getting into it. But the thing to do as soon as you get into it is realize you must get out of it. And unless you get out of it quickly and effortlessly, there’s no use staying in it. It will just drag you down. You could be spending years writing the same song, telling the same story, doing the same thing.
So once you involve yourself in it, once you accidentally have slipped into it, the thing is to get out. So your primary impulse is only going to take you so far.
But then you might thing, well, you know, is this one of these things when it’s all just going to come? And then all of a sudden you start thinking. And when my mind starts thinking, What’s happening now? Oh, there’s a story here, and my mind starts to get into it, that’s trouble right away. That’s usually big trouble. And as far as never seeing this thing again.
There’s a bunch of ways you can get out of that. You can make yourself get out of it by changing key. That’s one way. Just take the whole thing and change key, keeping the same melody. And see if that brings you any place. More times than not, it will take you down the road. You don’t want to be on a collision course. But that will take you down the road. Somewhere.
And then if that fails, and that will run out, too, then you can always go back to where you were to start. It won’t work twice, it only works once. Then you go back to where you started. Yeah, because anything you do in A, it’s going to be a different song in G. While you’re writing it, anyway. There’s too many wide passing notes in G [on the guitar] not to influence your writing unless you’re playing barre chords.
Source: Songwriters on Songwriting, Paul Zollo