You can definitely spend a few hours only in Singapore and re-enter Malaysia. From Penang, though, it would make much better sense to make your border run to Thailand rather than Singapore. Consider taking a mini shopping vacation to Hat Yai and return to Malaysia the same day. Much less time traveling from Penang - by bus, it's roughly 10 hours from Penang to Singapore - that's one-way - compared to around 3 hours to Hat Yai. Regardless of where you make your border run, though, you should have no problems re-entering on the same day - assuming that you don't require a visa (I'm not sure about S. Africa - if you got a simple 30 or 90-day stamp in your passport when you entered the country, then you don't require a visa). An alternative would be to take a ferry to Koh Lipe, Thailand. You'd have to take a ferry to Langkawi, then from there, catch the ferry to Koh Lipe. See
Tigerline Travel for schedules and prices.