So my question is, what are these parts purpose?
It looks pretty much like a reverse voltage protection circuit. In other words, if the incoming supply to VIN were incorrectly connected regards polarity, the MOSFET inside your red/orange box would turn off and prevent you circuit smoking.
Here's a link to a site that explains how it works. It uses a slightly different gate bias circuit but, in essence, it does the same thing.