It's a little more complex than that in that he's more like a demi-god who is sent as a hand of the gods (the Valar) into middle earth to oppose Sauron. Really, the entire story of LOTR was unnecessary - at any time, the handful of Valar sitting over in the undying lands could have decided they weren't down with Sauron's BS and simply ended it, but they didn't intervene directly, they sent agents - Gandalf, Radagast, Saruman, Alatar and Pallando (the last two of whom are in the east and aren't heard from) to influence events. That's just how they choose to intervene. So, Gandalf's purpose isn't to personally run the world, it's to assist and counsel and influence events without being the direct cause of them (though at times he arguably oversteps himself).
Really, the question of who happens to have control of Erebor at any given time is trivial politics to an immortal being who is thousands of years old. The issue is that Smaug could cause serious issues if he was involved in the war against Sauron and the western powers had to contend with him as well as Mordor (and as it turns out Isengard). Spurring on a quest to re-take the mountain is a way to fix that and thereby influence events to the detriment of Sauron, but it's only part of a larger purpose, which is why in the book Gandalf frequently disappears for long stretches of time to "attend to other business".
|