Reseating the RAM is certainly easy, and a real fix to many arcane power problems. Let us know if you've done that.
This seems to be iMac-related, I see a lot of similar posts around the web. If it were mine, I would be certain to remove any special Sleep or Hibernation setting, whether input by command line or via a 3rd-party Preference Pane.
If reseating RAM didn't help ... did you know, resetting P-RAM (NVRAM) and the SMC - Power Manager can be repeated ... and repeated. Especially the SMC.
The other thing to check is whether your second User Account -- which you did create for Fast User Switching, to test things like this, didn't you -- shows the same problem. Therein lies a clue.
And I would not own a Mac without also owning Disk Warrior. The go-to repair after Disk Utility. You've run DU from another startup source, right? Repaired disk and permissions?
Aha, so Apple is the one recommending a reinstall for every fix. Overkill, but I guess easier for them.
Keep trying - and uncheck that wake on LAN and anything else but the simplest sleep and wake. I highly doubt this is a network OR app problem, just a stubborn power glitch or setting the machine isn't letting go of.