One would have to make list and find the best combination of stock and functionality. And find isolated power for the high voltage side where the sensing happens. Chipanalog CA-IS3105W and others from that series would be my goto option for that.
My first thought was to run the 220V/5V into a high-resistance coil and use an analog Hall-Effect sensor to read the magnetic field and provide isolation at the same time. Then I facepalmed and remembered that he already had an opto in the circuit. So I figured there had to be a way to read the photodiode output as an analog signal.
I know it can work, I'm just not willing to put in the effort for free