Whistler has the best idea. Taking the train is easiest but the city you arrive in, Shenzhen, is a dump. Macau, on the other hand, is a fascinating city and you can still get the Chinese stamp by walking across the border into Zhuhai which is much nicer than Shenzhen.
I think the boat trip to Macau costs around 200 HKD each way so it is more expensive than taking the train to Shenzhen but I would definitely do this. If you wake up early (around 7) you'll arrive in Macau by 9, spend some time looking around until 1 or 2, walk across border into Zhuhai then walk back to Macau and take the boat back to HK. You should be back in HK by 5:30 at the latest and you'll have had a great day of sightseeing and you'll be worn out so you can sleep on your flight!