How to repair wall next to external door?
From what I can see in those images, I wouldn't bother repairing that drywall until the new door is in. Sometimes hanging/fitting a door requires a lot of work to get it plumb, straight, and level, and that may cause you to damage what you just repaired.

Once the new door is installed, you can see how the wall will need to be repaired relative to the new jambs. 95% of the time you'd just cover something like that with the trim and be done with it- no mudding or sanding needed, and only repairing if you have a gap or crack beyond what the trim covers.