What comes first installing the trim work or painting before installing trim. I get this question from time to time and want to discuss the different methods. As a professional trimmer I have worked for different builders and it seems they all did it their own way.
One builder I worked for would do it in this sequence every time.
The walls would all be sheet rocked, taped sanded smooth and finished without any paint. In other words all the mud joints and nail holes were visible but every thing was sanded smooth and ready for paint. They would then order all the trim wood for the job and have it delivered to the house.
They would let it acclimate for a few days in the house. After a couple days of acclimation we would be installing trim in the raw form, no stain or paint applied to the trim yet. After we were done they would have the professional painters come in and they would stain and varnish or seal all the trim wood. They applied the seal coat with a sprayer and were not worried if it got on the raw walls.
After the trim wood was dry and finished they would then tape off all the wood and then paint the walls. This sequence seemed to work well for the painters and produced a fast production rate. The draw backs of doing it in this sequence are using a lot of tape and time for taping off all the wood. Another draw back is you still have to be extremely careful painting next to the taped trim wood and the paint would invariably always bleed through the tape.
Another way of doing the sequence is going in and painting the whole room first. This is easy and fast because you can cover every thing thoroughly without worrying about the trim wood. Also this way there is no tape involved or very little.
Next after your trim wood has acclimated for a few days the wood can be stained and varnished or sealed before installation. It's important to acclimate the wood before staining so a little preparation is required for good trim work. Have all the trim wood, doors, everything totally finished.
Installing trim after every thing is finished is a little slower but for do it yourselfers in my opinion easier. You have to be extra careful of the newly painted walls so they don't get damaged when you are installing trim work. After the trim work is installed then it's just a matter of touch up staining with a brush filling nail holes and then finish sealing these small areas.
There really is no right or wrong way. You just need to figure out which way would be best for you. Installing trim is quicker and easier when every thing is raw and unpainted although the painting and staining is slower and a little more work.
Installing trim after everything is sealed, painted and finished is slower because you have to be careful about damage. Walls can always be touched up with a little spackle and paint should it get damaged although you have to be careful here so the paint doesn't flash in these areas. If this happens consulting a professional painter may be necessary to remedy this problem.