Best way to reattach this molding to the drywall?
For that type of heavy softwood trim on drywall, I'd use 2-1/2" 16 gauge gun nails, or get some 2-1/2" hardened trim/casing nails (which are significantly narrower then regular wire nails) and pre-drill through just the trim with a 1/16" bit. You want an inch of penetration into the framing, at least. 

Where it contacts the door jamb, 1-1/2" or 2" nails are adequate, but you could use the longer nails as well. 

You can also use a few dabs of construction adhesive or silicone against the drywall for better stability.