A nice character study with a bittersweet end.
The plot of this episode is described here, courtesy of the all-knowing Wikipedia.
This episode is the first real study into Anya's character in the entire run of the show. They've used comedic moments in her relationship with Xander and nervous moments in the aftermath of the break-up to touch on her deeper issues in the past, but this is really the first time we see into her past and delve into figuring out why she behaves the way she does. It takes a mass-murder (with a conscience now in place) for Anya to realize that her ultimate problem is not Xander or D'Hoffryn or Spike or any of the other incidental conflicts she's had in her millennium of existence, but a deep fear that she amounts to nothing - that she's as empty as her first husband made her feel. This fear causes her to lurch from one life-mission to another to avoid facing the possibility that if she ever stops, she'll disappear into nothingness (figuratively).
There are LOTS of real people out there who can relate to Anya here. To quote from "Avenue Q," there are plenty of us who fear they'll never find their "purpose." Anya has never accepted that life is what happens "for now," and derives its value from the love we can find for ourselves and our fellow men. Bottom line...although I was not thrilled with Joss's decision to blow up Anya's and Xander's relationship, I would say that, after this episode, they may both be able to admit that there is fault to be found on both sides. Anya rushed Xander to the alter because she was getting married for the wrong reason (namely, she wanted to embrace the version of herself that was in Xander's eyes when he looked at her to avoid finding herself in her own way and in her own time), and Xander never should have let it get that far before he too was ready.
The writer (Drew Goddard) did a very nice job piecing all of it together - making us understand Anya a little better. The episode even manages to end on a note that nearly brings a tear to my eye just for being so "right." Anya wondering whether she was really anybody and Xander calling her a dope. Anya accepting that label as "a start," and Xander walking off with the hint of a smile - the recognition of that part of Anya that he always loved.
So...attempted suicide-by-slayer, a cruel and vengeful murder by D'Hoffryn (of Halfrec) to repay Anya for taking back her spell and quitting his service, and a sad realization by Anya that she's never really learned to be OK with herself...and I still walk away feeling hopeful about her future. That's the mark of a good writer.
As noted, it's a well-crafted script. Characterization is spot on, emotional impact resounds nicely, and even the new musical number rocks pretty sweetly.
Hannigan was a bit off today, IMHO. She played the whole thing very numbly - that may be a directorial decision, but if so, it's a bad one. The difference between EVIL!!Willow and Holding-It-Together-Good!!Willow is pretty subtle and rather off-putting at least to me. The big fight between Buffy and Xander doesn't work as well as I would hope, either. Not sure what the missing ingredient was - perhaps SMG played it a bit too calmly? But Emma Caulfield was her usual radiant self and the guest cast was solid.
Anya has some work to do before she can figure out what she truly wants out of life - her, not whatever identity of the moment has been handed to her. We all could stand to be a little more patient and a little more self-aware.