if you're setting an object's variables from another objects script that kinda an anti-design-pattern... are you familiar with these? :
https://refactoring.guru/design-patterns
It seems like you're trying to achieve a private/public kinda thing where certain properties are only editable by the object itself...
If i understand correctly, you're tying to call "set" on this object from a script attached to another object?
In this case, you might consider structuring it like this:
in OtherObject.gd:
myObject.doTheSetting(property, value, self)
and in myObject.gd (the object where you're setting):
func doTheSetting(prop, value, who = self):
if who == self:
set(prop, value)
else:
if not prop in ["firstPropNotAllowe", "SecondPropNotAllowed", "etc" ]:
return
set(prop,value)
Or if there's more properties that are not allowed than allowed, then you just invert that last if statement, and put the set fuction inside that if block