There surely is a host of interpretations to the relationship of Gandalf and the possible basic plot of the LotR. I would like to bring forwards one more here (it's probably not the one I myself find the most convincing, but I think it deserves mentioning).
If the whole of the LotR is seen as a battle between the
Maiar in the ME, all with their own purposes, then it's clear Tolkien couldn't drop the only good guy out of the story. The key players that played their game of chess on the board of ME were surely Sauron, Saruman and Gandalf. Of these no-one was from ME, and as
Maiar, they all were grades higher and more powerful than the elves. So those three played a game, using elves, orcs, men etc. as their pawns to reach the ends they had set to themselves.
So was Gandalf bluffing everyone with his trick of "death" - both his pawns and his real enemies? (Looks like a Wizard WW-game on a grand scale...

)
Sidenote: I agree with Bethberry and Goldberry101, that Gandalf the Grey is much more of a character than Gandalf the White. The Grey's character had shades and nuances, the White is just the strategical & emotional "natural-born-leader": the Good-guy indeed (and those purely good ones are mostly quite boring, to be honest, evven if they are wizards).
So was Gandalf in the end the one character Tolkien had to sacrifice to the altar of the storyline?