I've always had great difficulty getting my head around the three exceptions that, when in play, allow a second entry (I think that's what it is, anyway).
As an example, is the following permitted: CPT-xDOH-OSL-DOH-LAX-JFK-GRU-LIM-xDFW-HKG-JNB?
If I've read it right the cost of a DONE5 ex-SA is less than a DONE4 ex-Egypt.