Most here probably already know about this procedure to align the upper receiver bolt stop pin hole with the grip frame bolt stop pin hole, but I haven't seen or read anything here so far. So, to help the engineer out, once again, here's a picture:
Once the upper is replaced on the grip frame, use the bolt stop pin on the mainspring housing assembly to align those holes like in the above picture. Once done you have the best way of alignment that you can achieve. The upper to the lower will be perfectly aligned forward and backward and then left to right.
After that verification, its a simple matter to install the bolt stop pin up through the bottom and a bit through the top of the receiver.