This presupposes that the extent of the damage was equivalent on both aircraft and that age in years is a fair measure of market value, both of which probably aren't the case. (Cycles and time-to-next-major-airframe-overhaul are significant additional financial factors, for example.)
However, that said, sometimes there are factors at work other than the typical cost/benefit analysis, and these lead to the aircraft being repaired rather than scrapped. Comparing to the automobile world, one would say the difference between considering the car "totalled" (a "total loss") or repair-worthy. As you know, the usual analysis is: What's the market value of the item? If cost to repair exceeds market value, then just write it off and scrap it.
Sometimes, things like lease provisions affect this analysis. If I'm the owner of the MD11 that Delta burned up on the ramp, and I have a contract that requires Delta to return the aircraft to me in working condition, and there's no provision for them to substitute an "equivalent" aircraft (i.e. go buy one on the open market and give me that one instead), then I can force them to repair it before return. I might use this provision as leverage to work a deal where I recoup all or part of the repair cost as an offset against the already-diminished market value of the aircraft, but there might be tax reasons not to do so. It all depends. In any event, my understanding is that in the case of the DL
MD11 that was repaired, the lease provisions altered the usual economics sufficiently that a decision was made to repair an aircraft that might not otherwise have been repaired.
Tax laws may affect the decision as well.
[Edited 2012-12-20 22:48:54]