I can't see citing 'self-defence' as the reason for throwing the punch would carry any weight in court. If someone has you trapped in a corner and appears intent on attacking you then it would would be reasonable to throw a punch in order to try to escape but there seems to have been nothing preventing your friend from simply seeking to flee from the situation, so he wasn't lawfully entitled to throw a punch.
See here for the view of the CPS regarding self-defence:
http://www.cps.gov.uk/legal/s_to_u/self_defence/
Your friend's best chance of avoiding a custodial sentence would be if his solicitor/barrister could get the charge dropped to Section 20 (GBH) rather than Section 18 (GBH with intent). Indeed, unless there's clear evidence that he made prior threats, I can't see how a Section 18 charge could be sustained against him. See here:
http://www.cps.gov.uk/legal/l_to_o/offences_against_the_person/#a16
If your friend is convicted under Section 18 the 'starting point' sentence (for a 'Category 3' offence, which would seem to apply here) is 4 years imprisonment (with the judge being unable to pass a non-custodial sentence other than in extremely unusual circumstances).
If your friend is convicted under Section 20 the 'starting point' sentence is a 'high level' Community Order and (although a custodial sentence is still a possibility), imprisonment would seem to be unlikely.
See here:
http://www.sentencingcouncil.org.uk/wp-content/uploads/Assault_definitive_guideline_-_Crown_Court.pdf