Re: crooked wall
I agree with A. Spruce.
Build a trough out of 1 x material like the picture below. Make the inside demension slightly wider than the thickness of the wall. Slid it on the wall, adjust to plumb. and nail in place through the sides into the wall. Hang you door and slip the 2nd trough on the other side and adjust to clearance for that side of the door. Then finish out the top to complete the door trim.
Be sure you live your life, because you are a long time dead.-Scottish Proverb