I might be wrong... but I think the quotes have to be in a certain spot for that command.. i.e. "_x setunitpos {up}" foreach units group this
These are all valid lines that will work in that situation:
"_x setunitpos {up}" foreach units group this
{_x setunitpos "up"} foreach units group this
"_x setunitpos ""up""" foreach units group this
OFP differentiates between {}, "" and "" "".
Believe it or not you can string multiple nested quotes within one another using the right combination of quotes.
(Stop reading now if you don't want to be really confused)
I often use a trigger to activate a script command by passing it a string. the string ends up looking something like this:
string = """_x setbehaviour {aware}"" foreach [alpha, bravo, charlie]"
Which will work fine, provided you don't miscount the quotes