When a transistor is used as a switch the VCE(sat), the collector saturation voltage, is typically around 0.05-0.2 Volts. This is what the input would see as a low level.
A blocking diode in series with the input raises the low level about 0.6 volts, lowering the noise margin a bit.
If the pull-up of the sensor is just the 4700 ohm resistor, adding another 470 ohms in series makes little difference. Just the zener across the input will protect it.
If the sensor had an active pull up to 12 volts that would be a different case, the 470 ohm resistor would limit the current into the zener.