I had the same problem with a MacBook "liquid spilled". The unit was always going to sleep but pushing the space bar I was able to wake it up for 2 or 3 seconds then sleep again. Strangely the MacBook was working fine when connected to an external monitor (no sleep issue) but main LCD screen was black (no video, no backlight). After replacing a few parts with no success the logic board was repaired in an Ontario electronic shop (I'm in Canada) for $200.
You may try to take apart the machine and clean the logic board and internal component to avoid corrosion then reinstall and test. If it doesn't work then the logic board is probably bad.