The first thing you need to determine when learning how to write a script is the movie genre your story takes place in. Each movie genre comes with it's own specific types of rules.
The movie Scream is a great dissection of movie genres in general. In fact, they actually give the "rules of the movie genre" in the beginning. Things like "you can never have sex" and "you can't drink or do drugs" because the sinners always die in horror movies. Somehow, the "innocents" always gain the knowledge and strength to survive.
Of course there are a few more "rules of horror movies" in Scream and even another set of rules in Scream 2. This is one of the aspects of a great screenplay that made this movie so incredible. It acknowledges the way of the world and then set out to deconstruct this tried and true formula. The box office doesn't lie: Scream made over 507 million dollars...
How to use movie genre to your advantage
Movie goers love to see something new, but they hate to be dissappointed. If you're doing a period piece, the actors better not talk like Bill and Ted's Excellent Adventure. If you are creating a romantic comedy, there better be tons of compelling romance, and it better be packed with funny stuff.
Let me revise my previous statement; movie goers want to see a new take on their favorite movie genre, but they don't want to have to redefine their favorite genre. What exactly does this mean? It means that if they are going to a buddy comedy, they are not going to be too happy when it turns into a slasher film. Even if your screenplay is a tour de force in redefining buddy comedies, people want what they expect. If you really want a great book on this concept, I recommend The Seven Moments That Will Captivate Your Audience. This is a scientific study based on the top grossing movies to include in every good screenplay. Giving people what they want has a lot to do with knowing what they want!
Movies that do redefine the movie going experience often do become quite successful as cult films, but that's if (and only if) they actually get made. If you have yet to break into the movie industry, save your unexplainable film for after you've written the next Ghost. After you've had a movie made, there are countless people who are interested in your more... esoteric stories.
For now, it's your goal to study films in your genre. How do the characters act and react? Is there a typical character flaw with heroes in that genre? What are the must-have scenes in your movie genre? What other elements have to be present for it to be considered that type of movie (i.e. action films have to have some kind of chase or final battle, or cop films better have some kind of crime to solve or prevent)?
Watch movies, take notes
Let's say you're making an action film. Go to the video store and grab a stack of genre defining films. For your action film homework, grab the standards like Die Hard, Raiders of the Lost Arc, Star Wars, Lethal Weapon, and some of the redefining movies like The Dark Knight, Kill Bill, The Fifth Element, and The Professional.
Lock yourself away for a couple days and watch everything. Take notes about things that happen. This can be the beat list, an outline, or whatever jumps out at you. You may start to see similarities. In fact, you better see similarities! There are things like gun battles (or sword fights) that happen in all of these. People get chased, cars might chase. There's usually some kind of love interest that spurs on the hero. There's a super creepy antagonist with a real motivation to be a scumbag. There is almost always a point where the hero has the chance to give up. Stakes get raised, decisions get harder, yet more simple because they force the hero to be heroic.
Are you following? Your action film better have all of these elements in some way or another.
What do you do with the rules?
Here's where it gets fun! Now that you've got a solid background in your chosen movie genre. We know what the basic story line has to be because we've seen it OVER AND OVER AGAIN in just about every movie we've studied. We know that we need rising conflict and we really need to push our heroes into heroism.
Now's the time to add your "twist" to the formula. This is the opportunity to really make this your character's story. Indiana Jones is terrified of snakes. John McClane has to save the building barefoot. Leon is a contract killer that has to babysit. Beatrice Kiddo has to learn how to walk again.
Let's explore this... Any time you give your heroes a real (and quirky) issue, then you have a truly unique story; one that a studio would be interested in. What if your movie has a priest with anger management issues? How about a biker who cries at classic films? A kleptomaniac cop?
Great characters have dimension. How cool would Star Wars be if Luke was already a paramilitary ninja? Not so much. The fact that he's just a "kid like me" inspired generations of kids to think thay have a chance at the same greatness. The fact that Batman is just a well-funded normal guy struggling with dark issues makes him a more compelling hero.
Set the movie genre on its side
Back to The Dark Knight, what made that movie so important is that it really got into the mind of the bad guy. All the other movies in this series, pretty much showed the origin of each bad guy, but never really crawled into the psychology of why they do the things they do. Sure, some baddies are just psychotic a-holes, but this dug deep into the terrifying mental state of the Joker and for the first time, made him into something truly frightening instead of a jack-in-the-box dressed like a pimp.
Even Die Hard gives us an in-depth view of the bad guy, Hans Gruber. Pretty much before that film, bad guys appeared already reprehensible and with no real motivation. When you give all your characters a real reason for the things they do, you can make a genre movie into something that appeals to all movie goers.
So what's the "hook" in your story? Sure, you're about to write the next Avatar meets On Golden Pond, but what makes this movie special? What part of that (besides the bizarre and impossible) premise sets your film apart from every other Avatar meets whatever pitchmen and women? There has to be something magical about your idea that would make a producer or studio executive say, "Holy crap! I wanna see that!"
When I was in screenwriting school, a industry guy came in and talked to us. His best piece of advice, "Make a genre movie that's %15 different from everything else out there. Keep everything that places your film in that genre, but make it really about your hero overcoming his interesting quirks.
Really get your creative juices flowing on this. The best way to mess with the movie genre is to "What if..." every aspect of your story to see if you can make it more interesting: "What if you turned your hot tub into a time machine?!!" Ooops! How about, "what if instead of murdering everyone, he forces them to make him a quilt at gunpoint?" Maybe that's a little obscure, but does your hero have to do to get the main girl? What if he hooks up with her mom that gives all the great advice? What if your cowboy thwarts the plans of the train-robbing bandits only to rob the train himself? What if the good guy spends the whole screenplay doing great things to set up a horrible disaster making the apparent bad guy (who's just trying to rob a bank) have to stop him to save the world?
Try "What if" for every scene and see if you can punch them up a little bit? Find out ways to respect the movie genre you're working in, but also tickle its toes a little bit!