Glad that you missed him!
And i understand that your adrenalin was flowing, and if asked to do the same thing i probably would have done exactly as you and put the firearm in my vehicle. But from my comfy chair just thinking about it, a good response i might use would be to ask if im required to, since i really hate unholstering when not necessary due to more chances of a ND.
Again, not trying to criticize, that just made me think about the situation, never really considered running into a cop who would tell me to leave my firearm in my vehicle. Business owners yes, just never thought about police asking you that.