The second example works, the first one doesn't.
var+iable+! is not "variable!", though...
#code$ = "var"+"iable"+"!"+"=3"
#rpgcode(code$)
...works.
Variables are divided into literal($) and numeral(!) and one of them can't be added or subtracted to another one, if types don't match. Use #cast-xxx commands to turn variables between numeral and literal.