It all depends. If you fry the optoisolator and surrounding traces, it could be about the same amount of work/money to repair it as if you fried MCU.
I don't think the resistor has a high probability of failing short if you get a resistor of good wattage and high value. I have my power measured that way.
From the safety standpoint, one of the main wires has to be "grounded" (e.g. neutral wire in North America or ground wire in Europe) while the other is "hot". If you connect your MCU ground to the "grounded" wire, it'll be safe. You can make it more safe if you make your PCB in such a way that in the case of failure the connection to the ground stays. This way, even if the resistor fails, the thin PCB traces to the "hot" main will burn down quickly and your device will stay connected to the "grounded" wire - will be safe to touch.