I have this problem in Maya 2012 (same in 2011).
I create some bones and controlers and I apply manually some constraint on it.
I then copy the script in a mel shelf.
I start a new scene and execute the mel script: Some of my constaint are duplicated (attributes in the channel box are green instead of blue because the constraint have been created twice.)
The problem seems to appear randomly because when I restart or try with Maya 2011 for example, some constraint are fine, but others are created twice...
Someone knows how to fix this problem?