Hi and welcome,
basically, you cannot, not like this.
This is the whole issue with inplace families.
to be able to add a shared param to a family, it needs to be a family! #ouroboro.
One way to tackle this is not to use in place fam in the first place.
You could use the pychilizer extension that has a script to take the volumes of your inplace fam and paste it in a generic model family template, making it a family.
how many times have I written the word family
from there, you can then edit the family and add your parameter
doc.EditFamily()