I actually think this episode may have been inspired by
Jinx High. (NOTE: as usual, the Amazon link lies about the publication date to try to make it seem new and trick people who already have it into ordering it again. It actually came out in 1991.) As a novel it included a lot of other stuff as well (including a sleeping god being awakened by all the magic use which would be Very Bad), but the core of the story is almost identical to this Buffy episode.
One interesting difference is that the witch accidentally jumped into her daughter's body centuries ago. Since then she experimented and cannot take anyone else's body, not even a son. The body must be her biological daughter. So she keeps doing so through the centuries becoming ever more powerful. Her style is demonic and she uses demons frequently.
The first victim of her at the start of the book is named Buffy, and I believe she was a blonde cheerleader.
The protagonist is a Guardian, which is the Witch version of Slayer (and includes lots of empowered martial arts action as well as sorcery). Her orientation is Wiccan, and being unaware of the demonic kind (though she knows demons exist), and also the intense power of the magic, she couldn't locate the actual witch for a long time, either, as no teen could have that kind of power and control. (Meanwhile, the mother's body, imprisoning the daughter, is trapped in a mental asylum. The witch arranged for that very well making sure the doctor was one addicted to drugs among other things, and with some manipulations of her latest victim it really appeared the victim was completely insane.)
One of the fun elements to me is that just as the protagonist was out of her element against a classical demon-worshiping witch, so was that witch with her who never heard anything as laughably gullible as Wicca. But as the protagonist witch is a Guardian invested with extra power, the two were more or less evenly matched, and each had special strengths and vulnerabilities compared to the other. Another fun part is the wicked witch also fed on negative emotions and so for the prom (or whatever school dance) she put demons in the instruments to be played there to excite viciousness and lust...but one guitar didn't work out right and talked like a hippie (knowing the shared universe the author created I'd say the guitar had once belonged to a Bard, another type of magic user in that world) that confounded her (but she didn't have time to set it right), and that hippie spirit became an ally to the protagonist.
Lots more to it. Another Buffy fan really can see how this inspired this episode as well. The ending of the book is much more open ended, though the witch is forced back into the mother body (the victim does not survive as she returns to her body just in time to be destroyed) and this makes it her last body ever...and she intends a painful revenge upon the protagonist as a result in the last words of the novel, and the protagonist no longer has the advantage of surprise as she did the first time. (As there were no more sequels I assume she succeeded and the protagonist died a painful death, and her vampire boyfriend as well.
😛 ) The ending is much more satisfying in this Buffy ep.
Anyway, still haven't rewatched this yet, will soon.