Yes, I did it the same way but using ‘data shapes’ nodes.
I tried a lot of experiments and I noticed that all work fine when I use .txt file which wasn’t use before in that model. When I run the script I’ve got all shared parameters in “Shared Parameters” manage and then I cannot assign them to new categories using Dynamo (despite I get a comment that all parameters have been added). But when I change .txt file to another - all work well.
To sum up, I can use that script only once - later I cannot assign parameters to other families.