My personal preference is to not write adventures with a highly specific script. I tend to put a lot of thought into the major NPCs (including villains) and their motivations and resources, locations, and just general worldbuilding. When I plot a game session, I think of interesting situations the PCs get into without bothering to come up with any specific outcome - as far as I am concerned, writing the ending to the story is the players' job.
And if I manage to get into the proper frame of mind for the NPCs, then I can easily react to whatever it is the PCs end up doing. So I don't have much of a script to begin with.
However, at the end of each session, I will ask the players: "What do you plan to do next?" This way, I can come up with some initial situations the PCs will have to face, and be able to improvise from there.
If the PCs come up with something completely out of context, and if I can truly find no way to improvise out of it, then it is legitimate to say: "Okay, I didn't prep for this - let's take a break and continue at the next session!" But that is rare.