I would say you're missing the quotes. Does it work if you set the env variable using '"whatever"' ?
The env variable (`#!defenv ....`) works; it is (`#!defexps ...`) inline in the script that triggers the parsing error when passed to `modparam(....., TEST3`).