At the last Sim Meeting, there was a brief discussion about allowing scripts to toggle the locking feature of prims or objects. This functionality could be integrated into llGetPrimitiveParams/llSetPrimitiveParams or established as an independent function.
For security purposes, a script should not be able to modify the state of a locked object unless it has already been introduced to the object. Additionally, the script should trigger a permission event and require explicit approval from the object's owner before executing any changes.