If I understood it correctly you want to provide the ability for the script to manipulate memory, and define the structure for the memory to help with that.
You should be able to do this quite easily by doing something similar to the dictionary add-on. Though add options to define the order and position of each attribute within the structure, and then also add functions to set/update the address of the memory block that should be read/updated via the object. You may also want to add safety checks on that so the script won't be able to read/write to any memory location (unless of course you wish to give total freedom to the script writer).