Getting the port door on with the barrel installed isn't a challenge mechanically. It is a challenge
OPTICALLY, at least for some of us. The real pisser is getting that silly little spring tensioned right when you install it. The pin goes in from the rear, through the back of the port cover, then through the spring (get an extra turn on it to tension it right), and then through the front of the door and into the boss on the upper. Now the fun: use fine needle-nose pliers or hemostats with
lots of light and probably magnification to install the little C-clip. It's a 1/8" clip, a standard size, but you can spend a few cents and get an E-clip, which is more rugged (and harder to bugger up).
With that said, it's still much less of a hassle to install the door before installing the barrel. The process goes front to back instead of back to front as above, and you make sure the clip is on the pin before you start. The spring is still the hardest part.
A lot of people have gone through listing all the steps for installing the barrel, but some of 'em haven't made it clear that you MUST torque your barrel nut before you ever worry about the gas tube. Get that barrel nut notch really centered, and you'll have smooth sailing. If it's a bit off, it's a royal pain to get the gas tube installed with some setups, and you could run into issues with the carrier key not sliding smoothly on the rear of the tube. Once the nut is torqued properly, then the order should be self evident - anything that's going to be captured by the muzzle device goes on before the muzzle device, and in "chamber to muzzle" order.