Locking a Text Entity prevents scripts from updating it


My Entity chat system fails if I try to lock the Entity.

It was my belief that Scripts would still work on a locked entity, I need to be able to update the text on a locked entity, although I can see where this has problems.

Is there a way of locking a text entity but still allow its Text property to be updated by script?
I currently use “user data” to put a code in which responds to my script, perhaps there is a way of allowing users scripts to bypass the lock and only be able to update the text if they have the right code.