Thank you for your suggestion. I will try to digest it and report back. I started to consider that comparing it to %genre% is not really necessary because it is being created by %genre1%, %genre2%, %genre3% and so on.
So the string just has to compare the contents of each genre other than %genre% and not append the term to %genre% unless it is different from the previous terms.
$if(%genre1%,%genre1%,)$if(%genre2%, / %genre2%,)$if(%genre3%, / %genre3%,)$if(%genre4%, / %genre4%,)$if(%genre5%, / %genre5%,)$if(%genre6%, / %genre6%,)$if(%genre7%, / %genre7%,)$if(%genre8%, / %genre8%,)$if(%genre9%, / %genre9%,)$if(%genre10%, / %genre10%,)