That sounds like a good idea, I like the idea to have all the expression in one place instead of in many different objects.
I just tried to get one of the formulas into the script and although the script doesn't produce an error, the variable doesn't show up.
I added something like this:
let TestVar1 = count(if(Status=1,LineID));
let TestVar2 = 1234;
The TestVar1 expression works like a charm if I have it as expressioin in the text Object. If I run the script with the above code, TestVar1 does not show up in my list of variables. So I added the line for TestVar2, just to see if the script may stop somewhere before but it doesn't. TestVar2 shows up, just not TestVar1.
Again there is no error message, there are no red squiggly lines under my code - in fact the editor correctly color codes all parts of the expression.
Am I missing something?