I've just updated to 2021R2.1 and it looks like analysis scripts can handle structures now..
So the main issue is that structuregroups cannot handles structs as user properties in a script. It looks like the GUI allows for it as type 8, but it doesn't actually work. It works for analysis scripts, but not setup scripts.
Do you know when structs will be implemented as a type in adduserprop?

For now I will create a for loop and loop through the sturcutre to manually create each user property.