Creating a unique ID for each song to avoid duplication

This does not look like the title to me.
This looks like the filename.
Check which data you already have in the tag fields. If they are empty or filled only with parts of the data that is visible in the filenames, then first import the data from the unstructured filename into the structured tag fields.

From there onwards, you can sort, filter, rename the files and see whether you really detect duplicates in that way.
See also this discussion about duplicates: