I think this should replace @esc with @sep and not with ';'?

In addition, I'd expect to have some way to escape the escape character, like "a;b" -> ["a", "b"], "a\;b" -> ["a;b"], "a\\;b" -> ["a\", "b"], "a\\\;b" -> ["a\;b"]. If you want to unescape \\ somewhere else is debatable (should be possible to escape every possible string also in cases where \\ is only unescaped at end of string).

Did not test it but it looks like it cannot cope with more than one \; in the same parameter, like "1\;2\;3" ->[ "1;2;3"] ?