Sorry I'm currently moving, so i don't have any time for scripting ^^'
Gonna look at it as soon as possible, don't worry.
If you want me to point how to fix it, you'll have to:
-modify the class1$, class2$... variable to include a ',' char as really first and really last char of the string (so for instance:
set .class1$, ",20054,19584,19634,19882,19605,31087,20341,20355,20354,20351,20352,20353,20356,20350,32109,32110,32111,32112,32113,32114,32115,32116,32117,32118,32119,32100,32101,32102,32103,32104,32105,32106,32107,32108,20241,20234,19506,20120,19521,19507,";)
-modify the compare to include this char. For instance:
set .@class1, compare(.class1$,","+@sold_nameid[.@i] + ",");
This way, you're gonna look for ",19537,", and not for "19537" anymore. Same thing, you're gonna look for ",537,", so it won't raise for element id that are contained into another (longer) one.
That's not the proper way to handle it, but without modifying the whole script, that's the easiest one ^^.
If you have issues to understand what i meant, tell me.