The code can be anywhere in the scene. You can access the whole script when you make it public. But you need to adjust the code. You can´t use it like it is.
If you don´t want to struggle with reading and writing xml files you could store it in the player preferences. But there you can only store one key and value. But you can serialize values "manually" to a string and store multiple values (strings, ints) in one value. I did this recently to store multiple string values as a…