No Movie is Written, It’s Rewritten
The main reason for the existence of bad scripts, in my opinion, is the unwillingness of the writer to poke holes in their own work and rewrite the draft until it works. A bad script can be full of bad dialogue, a flawed premise, or a sloppy plot. All are things that can and should be improved with a rewrite, sometimes two, three, four, ten drafts, or more.
"When I'm writing the first draft I'm constantly reminding myself that I'm simply shoveling sand into a box so that later I can build castles." -Jordan Peele
The purpose of a rewrite is to edit your own work, to rewrite the dialogue where it doesn’t work, to fix plot holes, enhance the plot, breathe more life into your characters, and make every moment as important as it possibly can be. Basically, make the darn thing better. Don’t be one of those screenwriters who send out rough drafts to people with the idea that “it's ready!” Rewrite it, then edit it again and again and again until it meets your standard, until you can read it and “feel” something. If it’s anything short of amazing in your mind, then it’s probably not worth greenlighting yet.