UI scripts is a very powerful feature of TestRail allowing to extend it with new functionality, write plugins etc. However, currently there's no way a UI script can store any extra data, which is not related to the tests, on the server (e.g. some UI script settings that shouldn't be hardcoded).
This would allow for creating complex UI scripts that may need to persist their state, some custom NoSQL database etc (for instance, I am interested in writing a TestRail plugin for steps auto-completion somewhere in the future, and that would require my UI script to persist an array of step strings). And allowing for storing/retrieving plaintext (e.g. separate files for each script, identified by filename) would be the simplest solution from your side.
With best regards,