As soon as Levi's swarm crosses the threshold to the room, it is blasted by a beam of cold from the hovering orb.
To-hit (1d20+8)[22] v touch AC
Swarm fort (assuming Bat swarm) (1d20+3)[21]
On a successful save, the swarm takes (3d6)[9] cold
As the swarm hasn't died and managed to resist being frozen the orb fires a second beam of cold within the same round, finishing the swarm off (probably). After a few experiments, it's determined the orb can fire up to three beams per round and detects anything that passes the door's threshold.