I believe Gandalf had an inkling there was trouble in the Shire (he had an uncanny presience, after all); however, I don't believe he was aware that Saruman was Sharky (or knew of the Sharky nick at all, for that matter). Nevertheless, 'The Scouring of the Shire' is one of the most crucial parts of LotR, because Tolkien basically wrote the quintessential 'coming of age' tale, and it was absolutely necessary for the Hobbits (Frodo, Samwise, Merry and Pippin) to solve the Hobbits' (as in the whole Shire's) problems by themselves, based on the experience they gained and travails they had to overcome throughout the book.
In essence, the Fellowship of the Ring (that is, the actual quest for the destruction of the Ring) was the training ground for these four Hobbits to gain the leadership skills necessary to overcome the danger they encountered upon their return to the Shire. Gandalf, had he even known about Saruman's presence, would most likely not have interferred with the Hobbits roles in leading the insurrection, as it is obvious he had an infinite amount of confidence in his Hobbit comrades and respect for their abilities.
It is also evident that Tolkien wrote 'The Scouring of the Shire' as an integral part of the story, with a particular emphasis on the growth of the Hobbit protagonists. They no longer needed the help of wizards or Dunedain Rangers to save their own, and this is one of the primary knocks I have against the Peter Jackson films. He missed the point entirely, it seems; or, rather, chose to glorify other lesser aspects of the story not in keeping with the author's intent.
__________________
And your little sister's immaculate virginity wings away on the bony shoulders of a young horse named George who stole surreptitiously into her geography revision.
|