If they buy it from me, I keep the money regardless of whether or not it gets produced. Which isn't always good. If a studio options a script, they own it. So it ceases to be mine. But that's how the game works. The name escapes me, but a famous writer once said, "As a writer, you have to know when to kill the baby." That means never fall in love with your story, your characters etc. The more you care, the harder it is to change things or let them go.
Anything and everything by Christopher Nolan, Quentin Tarantino(for the dialogue mostly), Akira Kurosawa, Alfred Hitchcock and Sergio Leone'. They're all brilliant storytellers. That's essentially what writing boils down to; telling a cohesive, entertaining and gripping story.