Try the following (untested code) and see if that does what you want.
$if(%genre%,$getmulti($if($is_multi(%genre%),%genre%,$setmulti(genre,%genre%)),0),Unknown Genre)/%artist% - %title%
There is also a file naming script tutorial available in the Picard User Guide that might help you understand the script.