We shouldn't answer these things on a Friday afternoon apparently. Now that I have reread the question and Pop's answer, I do have the order wrong. Your opponent is using Deck and Cover, which as Pop says is an attack effect. The attack effect happens during the attack before the KO check, and since you must always have an active Pokemon, Accelgor gets replaced. Then the KOs are checked, and the KO'd Pokemon is replaced.
BDS