Are you cleaning the cage with some form of cleaner? (or was that the aquaria you mentioned or did you mean his cage is an aquarium?)
If you are using some form of cleaning fluid the smell or fumes of the cleaner may be harming your dragon, hence why he does the funky dance and seems to 'pass out'.
If you are not using a cleanser at all or something mild like none perfumed soak or diluted novasan (or whatever that stuff is called) it could be stress from having you do that.
Then again you mentioned he does this every time the lights go out which is rather odd. The lights going out shouldn't startle your dragon unless they are very dark and the room is very dark when they go out. Sometimes keeping a room light on for a bit after his main lights go out, make the transition a bit more 'natural'.
Since he was frantically clawing at the sides of the cage for awhile while you cleaned before he collapsed on the floor of the cage and closed his eyes and kept opening them, he simply could be exhausted from his frantic attempts to get away from your hand (as you clean). He probably would fall asleep but your cleaning keeps disturbing him and that could be why he keeps opening his eyes.
Knowing more about your setup will also be helpful to get a better ideal what is going on. The temps you indicated is good and I think you mentioned you had a UVB light. Definitely go easy on the meal worms as they can cause impaction. What type of substrate do you use? How big is the cage? What sort of cleanser do you use to clean his cage? Roughly how big is your dragon and aproximate age?
If he seems to always run around frantically when you are trying to clean, it will be less stressful to just remove him from the cage, put him in a box (or tupperware container big enough that he can fit in without more than the last half of his tail being bent) and close the lid and put him somewhere quiet. Clean the cage, get it all set up again, put him back in then leave him alone to settle in again.
-----
PHLdyPayne