As noted in T214674#5396912, AbuseFilter currently allows declaring dynamic variable names with setter functions, e.g.
set_var( page_title + '_my_string' + ( page_namespace == 0 ? 'main' : 'foo' ), 'myVarValue' )
is valid syntax. However, the AF language is meant to be simple, and dynamic variable names are something complicated to deal with even in standard programming languages.
So my proposal is to only allow a literal string as first argument to set_var.