iTunes has a feature dubbed "Replace Existing": if you try to import CD tracks which iTunes detects have already been imported you can "replace existing" tracks with re-imported tracks from the CD and no duplicates are created. But this feature only works properly if the original track was imported by iTunes.
This script will examine your library for MP3 tracks from the inserted CD; if any exist which were not originally imported by iTunes (but perhaps by Audion, LAME, or Windows software) the corresponding CD tracks will be re-imported as AAC files and will replace the MP3 versions throughout your playlists, preserving as much original tag data as possible (play counts will be lost). Finally, the MP3 tracks will be removed, and the MP3 files will be moved to the Trash.
Note well: in order for tracks to match, their name, artist, album, and time must be the same. Read Me explains more.
OBLIGATORY WARNING! Because this script has been designated as a "Retro Script" there is no guarantee that it will function as described and may even corrupt or destroy data.