@pkrk – can you give us a more precise description? And some code?
Who or what wants to duplicate a swatch?
The user in the UI? Your script?
If the user in the UI, do you have created a ScriptUI Panel with some functionality that is visible in the UI while the user is doing "normal" layout work in InDesign? And if yes, why do you prevent the user from seeing alert messages setting the userInteractionLevel to NEVER_INTERACT?
What exact version of InDesign on what exact version of OS is this script running?
Uwe