I add small details like that after painting, like you did. However, you should remove the paint from the gluing surface. CA glue is incredibly strong for gluing plastic to plastic. It will stick to paint too, but the paint does not adhere to plastic as well as the glue, so at the slightest touch the paint bond will fail and the gun will fall off.
I use the thicker gel CA because the thin stuff requires a perfect fit and the guns are usually not perfectly round. To remove the paint I clean the hole by running a small drill (the next size up from the pin on the gun) through the hole. If you paint the gun befire you put it in, do not paint the mounting area. If the item is very small I often paint it after it is mounted.