What we did, was actually the opposite. We didn't using leaving as last recourse, it was FIRST recourse.
We had a problem both with throwing things and getting aggressive. Fortunately the throwing things (woodchips, sand, whathaveyou) came first.
When we parked the car, or got to the park, before I let him play I told my son that "remember, if you throw anything, we're going home." Invariably, he'd throw something. Sometimes within 10 seconds. And we went home. With tears. With yelling. With a hard next half hour. With mummy reeeeeaally needing a break. But we left. Sometimes, he'd get sneaky, and do the "test". Of course we talked about WHY we don't throw things...so he did it in the exact opposite way. He'd pick up ONE woodchip, or a pinch of sand (etc), walk as far away from everyone as possible and throw it away from them. And we went home.
Once we got home, he was on time-out, until we'd talked about it.
This went on every single day for a couple of weeks.
With being aggressive, it was the same thing, except that we didn't make him apologize & we didn't get specific. We said "Remember, if you're MEAN to anyone, we're going to go home." We didn't say hitting, because our son is Jesuitical. Elbowing I suppose is SLIGHTLY different from hitting. I was NOT getting into a debate about semantics, because I hadn't expressly forbidden "x".
We didn't make him apologize, because we apologized for him, saying in a loud voice "I'm soooo sorry he was mean to you!!! He knows he's not allowed to be mean, so he can't stay here and play and have fun anymore like you get to, HE'S going home."
This one got nipped quick. He'd already tested the going home bit, plus we laid it on thick about how much fun he would have had if he hadn't been mean and was still at the park...and did all the empathy stuff in private...so there was no rush, and no distraction.
Now with both we gave him options, and we did talk to find out what it was he liked about each. For the throwing things it was "Remember, you can't throw it, but you CAN make it rain, or dig reeeeeeaally deep holes, or or or (with demos)" ...and with being "mean" it was mostly reminders about asking. (Asking to get by, rather then pushing...asking or inviting to play rather then feeling left out...asking for a turn rather then grabbing and pushing...etc.)
We had him apologize (to other kids) for accidents...and for first offenses. We wanted to pound in that there is no recourse for doing something you KNOW you're not supposed to, just because you're angry...and to give him options of other things to do in those circumstances.
It's not easy...but it worked pretty fast.