If I remember correctly, depending on time of year and water levels, the boats don't usually reach Yangshuo until 3pm, so even if you jumped in a taxi back to the airport you would indeed by pushing it.
A quick look at Ctrip shows a Hong Kong Express flight at 6pm (UO4122). Remember when checking flights that those to Hong Kong are often listed under the 'international' category.
Look into flights to Shenzhen, which will be considerably cheaper and may be more numerous, from where there are direct cross-border bus services. There's certainly a China Southern flight at 21.20 that gets in at 22.15. The bus schedule is here:
http://www.chinalink.hk/co_service_routes17.html
Peter N-H