The one problem with being a GM is players. Not that they exist, but that they have wills of their own, and tend to use them. The bastards.
'But surely that creates a better gaming experience?' I hear you cry. Well yes it does, however it makes the GM's life a great deal harder than it already is. They do this by generally taking your finely sculpted, lovingly crafted plot, and then driving a truck over it. Possibly followed by a combine harvester.
This leads many GM's to the conclusion that preparing ahead of time for a game is a waste of effort.
They are wrong.
Preparing properly can make life a great deal easier. Instead of arbitrarily deciding what the players will do (a fools errand if ever there was one), decide what the villain's/monsters motivations are. What are they trying to achieve, what back up plans do they have for when things go wrong. Another thing to consider is location. What is it for? What was it originally for? When was it built and who built it? Has it been upgraded to its current state or is it as it was originally constructed? Going into detailed historical notes isn't necessary here, just a rough idea.
For example:
The cult's base of operations is in an old meat processing plant. They've converted some of the machines there into defensive mechanisms (ie traps), and the vast majority of armed cultists are using the old meat cutting equipment as improvised weapons, hence the disturbingly large number of meat hooks.
Simple, creates a running theme, and a little back ground information for the scenario. Doing this kind of thing can help with map design (if you do that kind of thing) since its easier to make up reasons for the rooms as you go along.
All this means that when your players inevitably go off track you have things prepared in such a way that improvising on the fly is a little more consistent.
I am currently suffering through such a situation in my current Eberron game, with the players going in a direction I never even thought of. When I said this they started trying to guess what I thought they'd do. No-one got close. Eventually I will tell them (as I'm sure they'll get around to it) but for now I have to run with their rescue mission idea.