Make or unmake a field unique using custom script

hi!!
I want to make a field unique or changing it to not be unique. But using Custom script.

image