I do just that in my own script. The tag %compilation% is true for Various Artist albums, so testing on that allows you to separate them out.
Here’s my script: