As a general rule, you should always raise the mainsail first, and take it down first.
Most sailboats will sail nicely on a close reach, (about halfway between a beam reach and a beat) using a simple tiller tamer or similar device to hold the course. If the boat heads up a little too close to the wind, the mainsail will luff and the boat will bear away from the wind. If the boat bears away too much, the increasing force on the mainsail will kick the stern to leeward, and the boat will come up gently to windward. Sailing in this manner, the boat will be sailing at low speed and with very little heeling, which will make it much easier for you to move around the decks. (From my description, it might sound like the boat will be oscillating on and off the wind a lot, but the motion is much more gentle than that, and it really doesn't oscillate significantly.)
If you raise the jib first, the boat won't self-steer very easily, and it'll go much faster, bounding over the waves. It'll also heel much more, making it more difficult for you to raise the mainsail.
Thus, if you raise the mainsail first, and set a tiller tamer to steer a course as described above, the boat will sail indefinitely, unattended, allowing you as much time as you need to hank on and raise the jib, tilt up the outboard motor, untangle any foul-up, or do anything else you need to do. Of course it's important that you keep a sharp eye out constantly for traffic nearby, while you're rigging the sail.
When you raise or lower the jib, the boat doesn't need to be head-to-wind. The jib will go up and come down nicely on a close reach. If your jib halyard is led aft to the cockpit, then you can steer the boat head-to-wind and simply let the jib fall onto the foredeck. If your jib halyard is cleated at the mast, then you have to let the jib luff while the boat is sailing on the mainsail alone on a close reach, and go to the foredeck and catch the jib with one hand while you gradually release the jib halyard with the other hand.