I have had this issues before , as a South African who has done this route many times i recommend the following.
Go for a meal at the Intercontinetal Hotel ( Africa's only 5 star Airport hotel ) , you will have a great proper meal and then in a timely fashion swindle to the check in counter in a timely fashion and then the rest is self explanatory ...
Do not bother going into Joburg , It will be getting dark , not the best idea to be walking around....
Enjoy