I do not understand the necessity to merge 2 fields into one without having the original structured data in separate fields. If you still have the mixartist in the field MIXARTIST, you can strip it from the ARTIST field, once you get annoyed with the flood of artist-mixartist-combinations.
So if you apply filters and actions to copy the data from MIXARTIST to ARTIST, you would not have to include an IF statement. This will eventually lead to an easier process to update the script, once updates are available as you have fewer local modifications.
Obviously ... while you ... and me ... do have no deeper knowledge how to apply the "Mp3tag Websource Scripting Language" within a websource script, ...
in order to remove a trailing comma ... or better ... simply not to "say" a trailing comma, ...
you are free to apply a following Mp3tag action, e. g. "Format value", ...
for the fine-tuning, after importing websource values, for example ...
ARTIST <== $trimRight(%ARTIST%,',')