There is a nuance. These really are not “globals” in the same sense as one has with .rules files. In a .rules file, that global variable can be referenced by any rule in that file. That is no achievable in the UI. Instead all you can really do is preserve a locally defined variable from one run to the next. The variable still only exists in that one context (Script Action or Script Condition). Given that, if you have two Script Actions, you can’t even share the variable between them in the same rule.
It should be theoretically possible to do this in all the supported languages, but I only know for sure how to do it in JavaScript.
So the tl;dr is, if it isn’t broken, don’t fix it. UI created rules really are different in how you have to think about them and the over all way to approach solving certain problems. You can’t just copy and paste all your .rules files into the UI and have them work. If you don’t want to have to rework, restructure, or out right rewrite your rules in a whole new language, keep them in your .rules files. They still work there too.