Because I wanted only this script, I just removed the part of the script which is above -- now, on to the fun part... and stored it in ~/Library/scripts/Mail Scripts. In Mail.app, select the menu item "Update Scripts Menu" then select all messages to be analyzed for duplicates, go back to the Scripts menu, and choose "Remove Duplicate Messages." The script then creates a new mail folder and moves all duplicate messages into this folder.

