I bought an used iMac with this problem for a good price to solve the problem, just like you. I got it temporary worked around, maybe you can try it.
Unplugging the power for a while and putting display brightness to lowest seem to have worked around the problem for a while.
I think the built in power adapter or backlight board is the issue. These are both always powered when plugged in.
This week this workaround didn't work anymore and I'll replace both. I'll let you know what the culprit was.
If you have it resolved before me please let me know what you did.
Dennis van der Pool