What you want to do seems feasible.
I had a look at the data sheet for the sensor, and it includes a circuit, using a 555 timer, which seems to be what you're considering:

- xyz.png (11.98 KiB) Viewed 2514 times
You could feed the output into the photocoupler, the 1k will result in ~10mA through its led. The photodiode would then pull down your chosen GPIO, to which you can connect a pull-up resistor in the region of 1k to 10k, up to 3v3.
Alternatively, you could dispense with the photocoupler if you feed the 555 timer output direct to your GPIO, with a 360Ω from there to ground (connecting also the timer's ground to the same point, of course) The 1k resistor and the 360Ω resistor form a potential devider to reduce the 12v to 3v3 for the GPIO.