I wouldn't recommend carting off to Indonesia or any other country. I think one reasonable option to Melaka-Singapore has already been given. Another is to head north to Penang, which I think would be my preference.
Return journey, 8 hours' stopover, I think I probably wouldn't go into town. If you are the type that doesn't sleep well on flights, might consider booking a block of hours at the KLIA Transit Hotel and getting rest and a shower. Or just see how you feel, see what the weather is, and make it up as you go. If you have lounge access in KLIA, that would help pass the time if you elect not to leave.