My music files are tagged with some custom tags, which for some reason aren't entirely standardized. This is probably due to some peculiarity with my MusicBrainz Picard set-up, but that is beside the point.

Anyway, when sorting by tags that should be equivalent, I would like each track to be sorted by the one tag it actually has. My approach is:

$if3(%albumartistsortorder%, %albumartistsort%) $if3(%original release date%, %date%) %album% %disc% %track%

What appears to happen instead is that the sort just ignores the conditions and reads the tag fields (including the parameters) as if there were no $if3() there.

A second approach is to write my own field remappings. According to this guide, the %artist% field is actually short for

$if3($meta(artist),$meta(album artist),$meta(composer),$meta(performer))

If I could define my own mappings like this, this would solve my problem. Is this possible, or what else can I do?