How about an Addaction script, say - this addAction ["Safety On", "safety.sqs"]
All the script would have to do is record the players current weapons and magazines, delete them, then add them back again weapon first so that they are unloaded.
Since it is an addaction you could do it as many times as you liked. You could even add a little sidechat or title cut like - "Weapon locked !". If you really wanted to go overboard, you could add a custom sound of the safety going on.
Not too hard I think but so far my one script attempt at removing and restoring a players weapon hasn't worked.
Future query topic that !
Rags