Optocoupler input protection
The circuit is good for protecting the diode.  I don't know of a better one.

You don't have to worry about protecting the diode from transients.  If a large current ( &lt; 1A) flows through the diode for a microsecond, it won't hurt the diode.  You can get away with a regular zener diode instead of a TVS.

You might consider using a lower zener (TVS) voltage, say 5V.  That will cause less variation of diode current between 12V and 24V input voltage.

Optoisolators tend to age poorly, and the CTR will decline over time (or at least they used to, maybe that's been improved).  So it's a good idea to drive the diode with more than the minimum current to be sure that over time the input drive will continue to drive the output.  10mA is probably a good number for an opto LED spec'd at 5mA minimum.