This is how it should have happened. .... I ask for you to remove your holster as I remove my sidearm and I tell you to place your holstered gun on the dash. If you comply without making the wrong move you do not get jacked up. Then I get your id and CCW liscense and run them. Your holstered weapon I put on top of your trunk until you check out.
Bullseye, do you routinely disarm licensed citizens you stop for traffic violations, or did I misunderstand you? If so, do you really prefer/instruct them to handle the firearm themselves? One reason I ask is that removing most of the holsters I carry in would involve having to remove my belt as well, which would be darned near impossible without getting out of the car. What would you have someone do then? Actually draw the weapon? I'd think that would be sub-optimal. Do you instead put that person on the hood of their car on the side of the public highway and disarm them yourself (uncomfortably similar to the treatment a criminal would receive)? Or do you allow them to exit the vehicle and disarm themselves, which puts you in a position of some risk as (again) you're having them handle their gun? One would think that if you get through the stop and the guy didn't try to shoot you, then you didn't need to disarm him anyway...
On the other hand, many of the rules of gun safety might get lost in such a high-stress and unfamiliar situation (for the citizen at least). You might end up with him sweeping you, you accidentally sweeping him, fingers on the trigger unintentionally and all kinds of accidental unpleasantness.
It just seems SO much (like INFINITELY) safer to stick to the "Thanks for letting me know. Please do not reach for or handle your firearm until I've let you go," model. Both of your guns can stay where they belong, no one is treated like a criminal, and the whole stop gets finished with much less stress for both parties.
Now here is what You should have done. As the officer approaches your window you tell him that you are a CCW and you are carrying. You tell him that your wallet containing your ID and CCW liscense are in your back pocket. You ask the officer how you want to proceed.
I agree with that advice, IF 1) you are carrying openly or in some fasion where the officer is likely to see/find the gun, and/or 2) if you state requires it.
In the vast majority of stops, the driver does not have to get out of the car. If your sidearm is concealed under a jacket and it isn't going to be exposed when you reach for your wallet or to get your registration, there's no good reason to put anyone's nerves on edge or put the officer in the position where they may make the kinds of mistakes that the one in the OP's story made. The gun ISN'T relavent to the traffic stop, so why introduce it into the mix? (Unless your state requires it, of course.)
Now if the officer asks you to step out of the vehicle for whatever reason, RIGHT NOW would be a good time to inform him/her. Him/her discovering the gun in the midst of the stop is going to be unpleasant for both of you.
-Sam