Perhaps the system.util.evalExpression() provided with Ignition Extensions would be useful?
system.util.evalExpression()