The strip of wood was a continuous piece that went all the way across. My guess is that previous residents snapped off part of it to install a screen door. Now that the screen door is removed, do I need to cover the area with molding, or can I just paint over it?
In my area some kind of insect would build in the gap if left open plus it lowers insulation value. If you don't want to mess with caulking any thin molding or trim strip could cover the gap. Trim can be installed with brads, small finishing nails or adhesive.
If there is wood underneath it would be attached to the wood with brad nails I think. There are thin nails used for door trim and baseboard. Some of the prehung doors come with the trim stapled on but that looks ugly to paint over. You can also use liquid nails/construction adhesive. Then you caulk around it and paint it to match the rest of the door trim. You might want a whole new exterior door casing kit. Make sure it`s for exterior and can be exposed to water, even if it is covered, the splashing of rain and moisture from outside can rot stuff meant for interior. If you find PVC trim, it will need to be painted to protect it from the sun.
Stay away from mdf! It is NOT suitable for outdoors. Composite and PVC are better for outdoors.