Well, here is something close to what you wanted in terms of cities that keeps within the 20 segment limit and the 2 flights from LHR to the Middle East. I threw in a few places in Oz and Asia that are interesting and give you some more mileage. If you are going to pay for a five continent trip, you might as well visit some of the cities in each one. If you are not wedded to going to South America you could drop back to a four continent fare and pick up some more cities in Oz and Asia and maybe some more miles. Five continents are just not mileage efficient anymore give the 20 segment limit.
cai-bcn//mad-gig-scl-eze-scl-dfw-anc-dfw-yvr-jfk-sju-lih//hnl-syd-drw-per-dps-hkg-dxb-lhr-cai
Note that I have not checked this itinerary extensively. I think it will work for all the flight segments but there may need to be a little tweaking done.
About 54,000 miles.