Whenever they chose to get married, if her old victim, now demon, came to screw up the ceremony, the results would almost certainly been the same, but we would have had to wait that much longer for the axe to fall. If, however, Xander and Anya had ELOPED at the end of Season 6, things would possibly have worked out better, at least until Wolfram & Hart sent an evil marriage counselor to Sunnydale to get at Buffy by screwing over her friends.
Joss had come to the decision that Xander and Anya had been happy for far too long for members of the Whedonverse, so, ultimately, their relationship as it had been progressing was doomed.
Whedonverse Prime Directive: Happiness and harmony (the feeling, not the vampire) must be eradicated at all cost, preferably to the displeasure of the fans, and the least popular relationships will seem to drag out the longest . That's the main reason Kennedy survived the battle in the Hellmouth. The series ended with only that relationship left intact, while Buffy had sent Angel away with pretty much the instructions, "Don't call me, I'll call you," Spike had rejected Buffy's declaration of love, Anya was dead, Faith and Wood were pretty much doomed from the get go, and Giles hadn't even had his casual stewardess girlfriend since "Hush" in Season 4.