lua plot expression: removed curly braces around expressions and handled invalid range values

"handle invalid range value" means: if LUA has no value, the TeX value
will not be changed (keeping its original value which might be the magic
constant invalid range)
fixed fallback to TeX in LUA survey and added 'lua debug' switch.

I also fixed the logging.