The foam air-seals and also helps secure the unit in the opening. I tilt the unit into the opening, then make sure I have an equal space on both sides, usually about 1/4 inch.
Because I've already set the shim screws, I know that the window is level along the bottom. Next I plumb one side, then the other, starting with the bottom installation screw.
Once I'm confident the frame is plumb, I screw in the adjusting screws located halfway up the sides of the frame, then install the final installation screws.
After opening and closing the window a few times and checking that the sash tilt out properly, I push up the top expander until it's about 1/4 inch from the existing jamb (to leave a gap for foam), then snap in the guide sleeve that covers the top screws.
Reapplying the stops as the foam cures saves me a step because I don't have to shave off the excess foam. I start with the top, then do the sides, often springing them into place to get a snug fit.