You were at a High School basketball game. You clearly went above anyone else there with your comments since you were the one ejected. It's not the NBA, NFL, or even College. It's High School. You don't insult the players or Refs. It's bad enough when the kids do it.
Your demeanor must have put the cops on alert, and for good reason. You didn't like getting steered out the door, and you did more than "bent over and grabbed my stuff". When you swung your arm around, you got calmed down with the Taser. It worked. When the cop let his finger off the button, you were in a much calmer condition. No lasting effect like there would have been if you had been sprayed.
I'd suggest you spend some time using the TV show Cops as a learning tool. While there's a bunch of garbage on that show, one thing that would help you is learning what does and does not work when dealing with cops. Moving your arms and body in a rapid way is one of those things that does not end well. You are lucky that you learned this part of the lesson in a well lit gym rather than out on a dark road somewhere on a traffic stop when the cop had no assistance, and couldn't see exactly what you were doing.
More information about formatting options