In the past we've interfaced with a similar circuit on a piece of military hardware, so I think you are on the right track. Ideally you would do a transient analysis of the circuit, but you need to know the characteristics of the spikes. To start, let us simulate the circuit in LTspice using a DC simulation:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/XnlVNQcg.png)
The following has been modified compared to your circuit:
- D3 was replaced with a 4.7 V Zener diode to limit current into U2 in the event of a spike.
- R7 and R8 were adjusted because of D3.
- R3 was added to simulate your microprocessors input resistance. The value was a guess.
- C2 was added to low pass filter the signal. The value was a guess.
- D1 was added in case of a negative spike on 12V. This might be unnecessary if you use a uni-directional TVS diode.
- R2 was added to decouple the input and output grounds.
- The TVS diode U3 was removed because I'm doing a DC analysis, and didn't want current to flow through it.
Sweeping V1 (the supply driving the 12V line) from -50 V to 50 V we can look at the output at DI0 and the current from V1:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/kEEk56pb.png)
When the 12V net is above 4.9 V, DI0 is below 0.3 V. Reducing the value for R7 will reduce the voltage at which DI0 goes low. D1 prevents any current from flowing when V1 is negative. So far so good.
Looking at the power dissipated by the input components:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/p5De5Lfg.png)
D1, D3, and R8 are less than 250 mW, but R7 is taking a big hit. You have several options at this point.
- You could use two resistors in series with a M6432 (2512) package to dissipate this power.
- If you know the characteristics of your pulse, you can choose a pulse withstanding resistor which will handle this power with a smaller package.
- Choosing the TVS diode U3 correctly will limit current passing through R7.
Obviously, a transient analysis should be done once you know more about the characteristics of the spikes.