This can be achieved with programmable logic:
PL1 -> Input: Dosing Pump, Function: Delayed off or NOT
PL2 -> Input: PL1 (Inverted if PL1 function is Delayed off), Function: Pulse

Switch channel X -> PL2 Inverted