Generally speaking, a quality overhaul (aka shop visit) can fully restore an engine to new performance level. But it costs plenty, and if a lot of time-limited (or cycle-limited) parts are involved, it may be smarter to buy a new engine which will have all the product improvements.
The retired engine can be stripped of usable parts; and the exotic alloys in scrapped parts have plenty of scrap value.