Saruman's links to the Shire start long before his arrival there.
In "The Two Towers," chapter "Floatsam and Jetsam", when Aragon, Gimli, and Legolas meet Merry and Pippin in Orthanc:
Gimli took some and rubbed in in his palms and sniffed it. 'It feels good, and it smells good,' he said.
'It is good!" said Merry. 'My dear Gimli, it is Longbottom Leaf! There were the Hornblower brandmarks on the barrels, as plain as plain. How it came here, I can't imagine. For Saruman's private use, I fancy. I never knew that it went so far abroad. But it comes in handy now?"
And near the end of the same chapter:
'All except one thing,' said Aragon: 'leaf from the Southfarthing in Isengard. The more I consider it, the more curious I find it. I have never been in Isengard, but I have journeyed in this land, and I know well the empty countries that lie between Rohan and the Shire. Neither goods nor folk have passed that way for many a long year, not openly. Saruman had secret dealings with someone in the Shire, I guess. Wormtongues may be found in other houses than King Theoden's. Was there a date on the barrels?'
In "Return of the King," chapter "The Scouring of the Shire:"
'There isn't no pipe-weed now,' said Hob; 'at least only for the Chief's men. All the stocks seem to have gone. We do hear that waggon-loads of it went away down the old roud out of the Southfarthing, over Sarn Ford way. That would be the end o' last year after you left. But it had been going away quietly before that, in a small way. That Lotho -'
As far as purpose, we get some of that in the same chapter:
'I did not,' said Frodo. 'But I might have guessed. A little mischief in a mean way: Gandalf warned me that you were still capable of it.'
'Quite capable,' said Saruman, ' and more than a little. You made me laugh, you hobbit-lordlings, riding along with all those great people, so secure and so pleased with your little selves. You thought you had done very well out of it all, and could not just amble back and have a quiet time in the country. Saruman's home cold be all wrecked, and he could be turned out, but no one could touch yours. Oh no! Gandalf would look after your affairs."
Saruman laughed again. 'Not he! When his tools have done their task he drops them. But you must go dangling after him, dawdling and talking, and riding round twice as far as you needed. "Well," thought I, "if they're such fools, I will get ahead of them and teach them a lesson. One ill turn deserves another." It would have been a sharper lesson, if only you had given me a little more time and more Men. Still I have done much that you will find it hard to mend or undo in your lives. And it will be pleasant to think of that and set it against my injuries.
The meeting in Isengard occurred on March 5, 3019. Gandalf, Frodo, etc. pass Saruman on Aug 28, 3019, and Frodo, etc., arrive that the Brandywine bridge on the evening of Oct 30, 3019. So we are talking about at least seven months, and probably closer to a year to establish connections, and close to two months of time in the Shire to do his work.