Villains have two or 3 modes. They have adult mode, where some(like this one) can be very hilariously mean, and a child mode or two, where they dial it way back. Sometimes with really young children, they dial it almost all the way out, depending on the performer.
I have always always had a favorite the princesses or villains and for me it was the villains i love how they can talk back and yeah i don't get why people yell at them but are the villains scripted and do they have to follow something on what they say are do they makeup the comebacks in there head
This is just from observation, but they obviously have to follow certain rules, they can't get TOO mean, or cuss. What they do is a combination of phrases and jokes they learn from Disney plus their own off the top of the head improvisation. This particular character performer is one of the best, and she has the amazing ability to mix Disney taught material in with her own, plus whatever she comes up with in the moment all within the rules Disney sets for them.