control a resistor connection in the circuit
The section you mentioned in the datasheet gives a couple of alternatives:

If the DPPM pin is floated (resistor disconnected) then the DPPM pin will be driven high and the charge current will go to zero. Note that this applies to both AC and USB charging.
Another way to disable the charging is to externally drive the DPPM pin high (to the OUT pin voltage).

You could insert a series transistor as you mention in the question. I would prefer not to add components into the signal path that could affect operation (at least not without calculating their effect), so the second option to drive the DPPM pin high sounds simpler. You could use a PMOS to do the connection. You might want to use an NMOS + pull up resistor to control the PMOS gate to make sure it is fully turned off when not needed, not looking like a parallel resistor to Vout (this would happen if the microcontroller voltage is lower than Vout).