I never could have done that.
I mean, how can you write without knowing what you are writing towards?
How do you think soap writers work? They frequently start storylines they have absolutely no idea how to finish - especially when it's a murder mystery or kidnapping.
Ah, but that's different.
Soap opera writers can write towards any ending they want, and they can adjust their plot depending on what happens. (And I'd argue that if it is a murder or similar, they MUST know where it is going, otherwise how are they going to leave clues? It's nearly always obvious when writers are just making it up as they go. Look at Lost.)
In the case of novelizing a story written by someone else, it is finished and you have to be able to lead to the ending that is already determined, even if you don't know what it is. Knowing where it is leading to can give the author a chance to build up something to make for a particularly powerful ending. I'm reminded of "The Never Ending Story" (the book, not the movies), in which the line, "But that's another story, and shall be told another time" was repeated. That allowed it to be particularly powerful when used as the last line of the book. If it had never been used before, it would seem like a complete cop out.
Another example is in my own novelization of "The Best of Both Worlds", which ends with Picard still hearing the voice of the Borg Queen in his mind (a change from the episode, but a justifiable one, and a lead in to First Contact). But without knowing that I was going to end the story with that, I might not have included the Queen in it at all (she was never in the episodes), so that ending (which works quite well, even if I say so myself) could not have worked. As it was, I was including the Queen anyway, even before I decided on that ending, because I wanted to have Picard speaking to her during the "Death is irrelevant" scene in Part 1, so that bit worked out, but I got lucky.
I'm assuming that in the case of novelizing a script, the script has to at least generally point to a reasonable conclusion that wouldn't require too much rewriting if the novel zigged a little somewhere.
True, but such would really only be the case in rather bland storytelling style. It would be like trying to tell a joke without knowing the punchline. You wouldn't know what bits of the build-up to actually build up!