Before automatically "fixing" the duplicate IDs, you should do a little thinking about why the duplicate IDs exist and what your use of the imported file will be. If you are planning to synchronize the material in the imported file back to the original model, you could have problems if the IDs of the imported material get changed. Also, if you've been sharing material across models with imports or controlled units, you may have items that are truly duplicates; and you need to decide what to do about the duplication. It is also possible to create duplicate IDs in the same model if you are using controlled units and moving classes from one package to another.
I suggest you open the model and petal files in a word processor and search for the duplicate IDs. The syntax of the model is messy, but you should be able to get a quick understanding of what the items with duplicated IDs are.
If you are using multiple controlled units (.cat files), I have scripting that will tell you which files the duplicates are in. I also have some scripting that will search for the actual items with the duplicate IDs.
