Writing Screenplays can be difficult, especially when you're committed to an idea that just doesn't seem good anymore. You have it to suck it up, write it out and see whether it's bad or not.
My solution to writing scripts is to write out the story beats first. Dialogue always comes second to a story, so it is not important to think up dialogue on the fly. And by beats, I don't just mean beginning, middle and end, I mean everything that happens in between. Think of the three act structure. In the first act our main characters are established, their motivations are laid out before us and their world is set up for us. The second act is the meat of the story, something must cause our hero to take action, e.g. Luke going with Obi-Wan in Star Wars after his aunt & uncle are killed. The second act is where you get have fun with your idea, showing off everything that it has to offer. By the end of the Second act, our hero is at their lowest point (again Star Wars does this really well), and they need to change for the story to continue. In the third act, everything will come full circle, our character will have changed into a completely new person, and whatever troubles they have are vanquished (or not in some cases), the story will then end, tying up any loose threads, and perhaps making more.
Point is, when you approach any written work, you need to know how it will flow, and where it will end up. Otherwise you'll just be stuck.
Hope this helps, screenplays can be a ***** to write sometimes.