I tried to feed him the bloodworms again and he was having none of it. I dropped the worm and when I tried to grab it to prevent it from rotting he spooked and swam to the middle of the tank, doing his sideways swim again, before nosediving
I've got the lights completely off again and I'm leaving him alone so he can recover from the stress again. He's back to gasping hard enough to move his whole body again
Since he's been at this horrible gasping phase at least twice before I'm thinking he will be able to recover, but I'll have to be more careful in the future about spooking him