Thank you for that comment, it saved me a lot of additional time.
I did find a way to pass variables to functions. You are right about not being able to pass variables, normally, but it seems it has less to do with them being literals and more of a parsing issue with the $. As long as the $ does not come first in the function, it seems to work:
<!--This does not work, as mentioned-->
(set: $n to 25)\
(set: $b to Math.sqrt($n))
sqrt of $n: $b
<!--This seems to work-->
(set: $num to 25)
(set: $num2 to Math.sqrt( 0 + $num ) )
<!--This also seems to work-->
(set: $num to 8)
(set: $num2 to Math.pow(2,$num) )
<!-- But this does not work -->
(set: $num to 2)
(set: $num2 to Math.pow($num2,8) )
I feel stupid having to write that, but it works, and shouldn't break if the bug is eventually fixed, so I guess I am going with it.