You were definitely correct in your actions. Would you rather be in the garage without your firearm and need it, or in the garage with your firearm and not need it? Was the pistol really that hard to put away after everything was verified safe?
My only critisism was that your pistol was locked up but I, of course, don't know your home/living situation. I don't want to be unlocking anything under stress (if I don't need to) if someone it breaking in to my home and threatening me.