It’s not quite clear if you use this in the filenaming script or in Options > Scripting. Depending on where you use this it does different things.
In filenaming script it will write the artist if it set, else the artists if it is set and lastly albumartist with Snoop Doggy Dogg replaced by Snoop Dogg.
In Options > Scripting it will do effectively nothing, because no tag is being assigned a new value.
I’m not fully sure of your goals, but assuming you want to replace the name in all three tags (artist, artists, albumartist) you will need to use the following script:
$set(artist,$replace(%artist%,Snoop Doggy Dogg,Snoop Dogg))
$setmulti(artists,$replace(%artists%,Snoop Doggy Dogg,Snoop Dogg))
$set(albumartist,$replace(%albumartist%,Snoop Doggy Dogg,Snoop Dogg))
Note the usage of $setmulti for artists. Because this is a tag with multiple values you need to use $setmulti, otherwise it would get converted to a single value tag.