Replacing genre name while using double backslash separators

I use MusicBee to organize my music library, and the nice thing is that it allows for multiple genres. When I store multiple genre tags on one album, it'll show this in Mp3tag with as follows:

Genre 1\\Genre 2\\Genre 3\\etc

Now I decided that I wanted to change all music I have tagged as "Melodeath" to have its genre tag changed to "Melodic Death Metal". However in every batch way I try to do this, it gets rid of all the other genre tags as well. So far I tried the function

$replace(%genre%,Melodeath,Melodic Death Metal)

but that doesn't work. I learned that Mp3tag treats the double backslash as a tag separator, so it creates multiple genre tags in the file. Is there a way I can circumvent this while replacing in batch?

I think you have to create an action group with 3 actions, that are executed subsequently in one go.

  1. Action "Merge duplicate fields"
  2. Action "Replace" your unwanted genre-string
  3. Action "Split by field separator" to separate them again

You could try:
$replace($meta_sep(genre,\\),Melodeath,Melodic Death Metal)

How do I merge duplicate fields?

See here:

This works! However it does give an extra space before the entire field?

The scripting command itself does not do that. So please check your configuration.