$put() cannot be an argument within another Mp3tag function call.
You have to change the expression to something like this:
$put(x,$if(condition,yes-case,no-case))
You could try the following, or some variation of it that applies to what you want.
When dealing with "Various Artists" I use "Various Artists: Genre" in %band% (Album Artist) and the artists playing the song in %artist%
So, when using this, I just compare whether the first 7 letters of %band% are equal to "Various" or not, and if so, I use that field. Otherwise, I use %artist%
Various - Year Y - Album X
or
Artist - Year Y - Album X