To avoid writing a Mary Sue in screenwriting, your characters must be filled with flaws, have difficulties in overcoming obstacles, demonstrate realistic and believable strengths, have clear goals and make active decisions to achieve these goals.