No. Light gun games rely on the fact that a CRT display will draw the picture on the screen pretty much at the same time it's generated by the console's video chip. Modern digital displays introduce all kinds of delays due to processing and buffering they do. Usually several frames worth. This shader can't do anything to fix that.
For the longest time, I thought this was the only limiting factor, but modern panels are low enough latency for it to work, yet still don’t.
The other important factor is the light filter. The NES Zapper has a filter designed to only be sensitive to high-frequency light sources like CRT screens.
That said, I bet you could fake the electron beam position with a high frame rate display, a modified version of this shader, and some kind of calibration routine…
You don't really need to emulate the position of the beam, at least not for the NES light gun. When you pull the trigger, the game first makes the entire screen black for one frame, reading the sensor in the gun and checking that it doesn't detect any light, and on the next frame, a white box is drawn where a duck would be. If the gun does detect light on this frame, it's counted as a hit. That second check is performed while the frame with the white box is still being drawn because CRT phosphors decay fairly quickly. You could, in theory, work around this with an LCD/OLED display with a high enough refresh rate that it would make up for the buffering delays.
Ah dammit I actually knew this, but was thinking about light guns in general. That's a great point, it should actually be super easy to generate a video output compatible with a (S)NES light gun. As penance I'll consider digging one up and adding support to an emulator. :D