Decide who your characters really are. The funniest dialogue comes from the truth: Truth in behavior, truth in people's mistakes, failures, triumphs, flaws, and characteristics. Is your main character sarcastic? Is his love interest clumsy? Brainy? Flighty? Whatever traits you decide that your characters possess, you will "find the funny" by exploring said characteristics. The dialogue will never be witty if it is not genuine and does not ring true to who your characters are.
Be consistent with your characters. Once you've decided who your characters truly are, stick to your guns. It might seem easier to have "John" say something sarcastic in a given scene, but if "John" would never be sarcastic, then the joke would work better if "Jane" were delivering it.
Use the “callback joke.” A callback joke is a joke you use once, and then again later in your script. If you are being consistent with your characters, then you can be sure to get some laughter from the callback joke. If “John” always forgets his keys, have him forget them again in the final act of your script, and gripe about it. The audience will feel that they know him well because they’ve seen him repeat behavior, or personality quirks, and laughter goes hand and hand with understanding.
Take your time developing your word choices. Certain words are just plain funnier than others. When sarcastic "John" pokes fun at his friend "Jane" for wearing a Roman-inspired outfit change his line, "Nice DRESS, Cleopatra!" to "Nice TOGA, Cleopatra!" Even after you complete the script, look over the entire script's dialogue and see if you can inject some more humor by changing a few words to witty synonyms. Use a thesaurus.
Make a habit of carrying a notepad with you at all times. Seek inspiration from funny friends and family. The next time you are at a family reunion, bring a notepad. You never know when that wacky uncle will say something so witty it deserves to be said by your main character. People are funny!