what your trying to do is not all that easy, especially with milliohm accuracy,
how i would attempt measuring the esr would be, trigger the circuit off the gate pin, when the gate passes a threshold voltage,
you measure the voltage across it, you then pump in a decent whack of current and measure the difference, but in both cases you want both the current source and adc disconnected before the mosfet turns off again, thus triggering on the gate,
at 5Khz, you could likely get away with a micro looking for a high or low pin,
same for the gate threshold, a comparitor looking for it exceeding or falling beneath a certain voltage to begin to measure,
you can even chop your current in and out multiple times to get a more accurate measurement,