One often overlooked aspect of the 'repair' or 'scrap' equation is the availability of replacement aircraft. The 777 remains a very popular aircraft, and while a few dozen have been retired or "permanently removed from service", those aircraft are well and truly knackered. Delivery slots of new 777's are pretty much non-existent for the next 3 years.
There was a case of a 747 heavily damaged in runway over-run back in the 1980's that was repaired and returned to service even though it cost more to repair than it was worth, simply because they needed the aircraft and Boeing didn't have any available delivery slots.