<snip>
tl;dr: let's not pre-ruin the plots with the anticipation that the players would have ruined them anyway. They'll ruin plenty without our help. I present the scenario with a poker face, and when they buy in, plot twists happen.
I'm suggesting that the DM needs to have a fairly sound grasp of the situation and the ramifications of player success should he try to move a group unwillingly through play to a specific situation. Often the simplest (although very annoying to the players) approach is to start at the necessary initial situation.
If the DM wishes to play out the situation, it also helps when the DM has a firm grasp over both what is possible and what is probable as he tries to move the group from situation A to situation B against their will.
A DM can always force such a shift since his resources are inifinite and open ended. But, actions and resources are remembered by the players and will be turned to when they think such resources should reasonably put to their ends.
If an invisible silent Wizard casting silent dimension door/Deep Slumber/Hold Person spells helps the guard with such a pasky problem today, why cant he help when the situation has becomes so much worse on a later adventure? If slow-acting poisons work cumulatively now and are cheap enough for that many doses to be dumped by the town guard, why don't they work that way when we're trying to take out the evil keep's garrison?
If you need a deus ex machina, present it as such. It prevents a lot of twisting, wasted time, and potential for the situation to spiral out of control.