As I understand the situation ...
- You speak of CatalogID, CategoryID, ProductID, so CatalogID and CategoryID are used as synonyms?
- Does the CategoryID have the importance of Genre or other musical classification? Or is it in your case of application just the same as the folderpath?
- The ProductID is needed per track? You want to create the PRoductID simply by appending a running number to the CategoryID?
- Does it be true, that all IDs are not visible to the user, must not be human readable, and are only used internally by the database?
I recommend to use a GUID as ProductID per track and a GUID per Album as CategoryID.
GUIDs can be created rather easy.
See also ...
Cover Bilder exportieren - importieren
Once the GUID list file has been created, the converter Textfile - Tag can import the GUIDs into the tracks.
If you want to create your own running number based routine, then you may play with the following MTE export script to understand how to code a $loop() ... $loopend() structure and how to use %_counter% placeholder.
Be aware that the Mp3tag Export Scripting Language does not support to $get() a $put() variable within a loop, which has been defined outside of the loop.
DD.20110529.1637.CEST