Gandalf certainly knew that there were problems in The Shire for the four Hobbits to sort out but we can only speculate on how much he knew.
Would his presence during the Scouring have made much difference? A fight with Saruman's men was inevitable. I can see Gandalf drawing his sword to protect any hobbits who happened to be within his reach but not to lead an attack; that was not his way.
As for confronting Saruman, I believe that Gandalf had gone to the limit of his powers when, at Orthanc, Saruman was humiliated, cast from the Order and had his staff broken. Gandalf could do no more.
Merry and Pippin had been exposed to Saruman's only remaining weapon, his Voice. They had seen him crawl. They could not be awed by him.
Gandalf was right to leave things to the hobbits, The only difference his interference would have made would have been to make the hobbits believe that they would always have to rely on Outsiders to solve their problems.
.
|