My method.
Prepare car for paint
Epoxy prime the seams and insides of the seam trims
fit to car with clips and a small amount of adhesive sealant (not sikaflex)
Seal the tops and bottoms of the trims to the body as per factory, again using adhesive sealant (not sikaflex)
Paint car
When it comes to machine polishing, I just stick 2 layers of masking tape to the seams to protect from the polishing pad.
This method is best in my opinion as the epoxy protects against corrosion, the seam trims can be sealed to the gutters as per factory before paint and the small amount of adhesive sealant will allow the trims to be removed in future if needs be but I really cannot see a reason to ever need to remove them.
As for fitting them after paint, just do the same method making sure you touch in and bare areas that the serrated clips might have caused when fitting them before clipping the seam trim on.
I suppose you could even seal the trims top and bottom and then blob a bit of paint over the sealer once it's cured