"Brandishing" is one term the law uses for a threatening display, and it's frowned on. So keep in mind, that you are not the one who is threatening people; you are the one being threatened. You are trying to keep the situation from escalating, and to get out of the situation so you can call the cops.
The gun does NOT take the place of calling the cops. Don't ever make that mistake, the one where you say "Well, glad that's over." It's not over until the cops have taken a report. Make sure that YOU are the person who calls the cops. You want the cops to see those kids and the kids to see those cops looking at them, but failing that, you want it written up as "Gang chasing a woman," not "Kids report woman with a gun." Permits are still too damn hard to come by, and you do not want to lose yours. The first person to a working telephone wins.
Find a copy of the book In the Gravest Extreme by Massad Ayoob. He's a police firearms trainer who spends a lot of time as an expert witness, defending cops and citizens who are being sued or tried for "excessive force" because they shot criminals.