Emma's evil plan is: persuade Kitty's parents to withdraw her from the Xavier School and send her to the Massachusetts Academy instead, and then hope that Storm drives her there. This works, and she body-swaps with Storm, drives back to the X-Men, finds that Shaw is already attacking them with Sentinel-derived technology, defeats them. Storm manages to escape from her cell, persuades Kitty of her identity, drives back, liberates the X-Men, and leads them to victory against the Hellfire Club.
Where this body-swapping gun came from is never explained. Such a technology would be very scary: Whedon's Dollhouse begins to explore the possibilities. X-Men again picks up an idea, uses it, and then discards it just as easily without considering the deeper implications.
It came as a surprise to Storm that Frost is still alive, which implies that the X-Men have not been watching the Hellfire Club too closely. Xavier ought surely to have known, if he'd been monitoring them. And the plot only works because he's had a sudden case of ethics - the old Professor X would have short-circuited this by just changing Kitty's parents' minds.