Actually, I think what might be the 'obvious' route would be that cost is equal to the cost of the new item minus the vendor/disenchantment cost of the old one. Allowing the full cost of the old weapon, instead of 1/5 of the cost, is a good bone to throw to players, but I can see how some DMs...