a different approach would be regular expressions.
there you have markers for the start and the end of a line (^ and $)
and you can work with palceholders.
you need a actiongroup with a extra action for every genre. with this actiongroup, you still can run it over all files at one go.
it will take you some time to understand the concept of regular expressions
http://help.mp3tag.de/main_scripting.html#string -> $regexp(x,expr,repl)
but when you have something like hundred differnt spelling variations of genres, it will be faster as the standard $replace funtion.
this will transform all combinations which end with "rock" into "Rock". The "1" at the end is for ingoring case, so also "rock" will be transformed into "Rock"
$regexp(%genre%,^(Rap|Hip Hop|Hip Hop/Rap)$,Hip-Hop)
this will transform the thre expressions in the parentheses into "Hip-Hop", but only if they are the only word in the tag field. So it makes no difference here, in which order you write the regular expressions.
this will pick the first genre if you have multiple genres seperated by a comma, like "Techno, Electronic".