Good advice from all. My two cents...
My first suggestion is this: Throw out the module. If you write the adventure yourself, you'll be more comfortable tweaking it on the fly.
My second suggestion: When you write the adventure, don't script out a rigid plotline. Instead, make up a general scenario, and put together a bunch of encounters (both combat and non-combat) that you can throw at the PCs whenever it's appropriate. If you don't have a plan to begin with, the PCs can't deviate from it.
By way of example, you could create a scenario in which the PCs are tasked with infiltrating a castle and killing the evil wizard who rules it. The castle has a network of caves underneath it filled with all manner of aberrations and demons, the result of the wizard's experiments in summoning and transmutation. The castle itself is guarded by the wizard's mind-controlled warriors. Being as the bad guy is a wizard, you can assume that he's warded his castle against most forms of magical ingress
*cough*teleportation*cough*; however, the caves beneath have no such defenses.
Then make up a bunch of encounters. Have some monster encounters for the PCs to fight in the caves, and some mind-controlled warrior encounters for them to fight in the castle. Add a few other interesting items, like an imprisoned devil that the PCs can talk to and maybe get help from (at a price, of course), and a few warriors who've slipped free of the wizard's domination. For each encounter, consider what might happen if the PCs try to talk, and what might happen if they try to fight.
Don't plan out exactly where to put the encounters, though. And don't figure out how the PCs are going to get into the castle. That's their job. Let them come up with a plan and put it into action. Any time it seems like they're having too easy a time of it, lob one of your encounters at them.
It might help to think of yourself, not as a novelist or adjudicator, but as a sadistic scientist. Your goal is not to determine the outcome, but to poke the PCs with pointy sticks and see how they react.
(This is not a universally approved approach to DMing. Lots of folks prefer more of a "static-world" approach where the DM lays out everything ahead of time. But if you're having trouble improvising, I think this is a good way to learn.)