With being 14 years old and dark, it's possibly he mistook you for a stranger since you said he doesn't like strangers.

At 14 it's possible the hearing and eyesight aren't what they used to be, and maybe he panicked at bit finding himself locked in. When the door opens he might not have been sure who was trying to hold him and a few dogs crowding around him may have been the straw that broke the camel's back so to speak.

Also there's the possibility he could have something going on that's not easily visable, cats are really good at hiding things. Maybe a vet check up just to be sure something else besides being locked in a room could have caused it?

Hopefully you won't get scratched up again and the scratches you have now heal quickly.