I'd say you've answered your question yourself, by listing the various scenario's, any or all of which could be of concern in a particular situation. Handling a diverted flight is a juggle between, safety, time, comfort factor (for crew, for passengers), cost, etc. In turn these are affected by feasibility, location of base (for replacement of crew/airplane), ease of availability of replacements, number of passengers, break up of their final destinations (likely factor when flying to long-haul to a hub), fuel and tech facilities available at the diversionary airfield, whether local 'diversion handling' contracts are in place, or the situation is being handled on-the-fly at an obscure airport. Airlines tend to have their own tailor-made SOPs, or guides.
These issues are ideal ones to be addressed by Airline Alliances such as STAR or 'One World' and traditionally all help is given to such flights. "You today, could be me tomorrow"
Assuming the airplane is ok, The change of crew may not be required if the remainder of the flight fits within the DTL's (Duty Time Limits) and the extra landing for recovery falls within the ambit of the rules. Crew are expected to be rested enough, when reporting for Flight Duty, to operate to their limiting DTL's. There are allowable extensions to these limits too, provided every crew member is upto it, ie not fatigued, and the Captain judges it to be a true reflection of the situation. The Captain would have to document all this in the Regulatory/Company paperwork. Note that Long-haul flights carry more crew than the minimum for shorter flights, so all crew get some time-out and an opportunity for horizontal rest, ideally in the form of a 180deg reclinable seat or bunks, normally in a private crew rest area.
For Ultra Long Haul flights, the hours, and crew numbers are ideally decided on a case by case, 'city-pair' basis, along with the Regulator and related procedures documented by the Operator, acceptable to crew, and approved by the Regulator.
In case a layover has to be declared by the Captain, many Operators/Regulators have a concept of Minimum Rest, which maybe typically 8 or 6 hrs of undisturbed rest, sometimes called (hotel) "key to key" time. This may provide more certainty than organizing a relief airplane that has to fly 12 hours to get there.