I don't think you can block user edits with a script. If you ever find a way, it's all about a file that one can easily move out from script folder anyway so looks like a deadend to me.
What you might consider is using InCopy to limit edits to whatever you decide.
The alternative is to prevent user from taking a seat in front of the computer.
Well, check out this thread:
The idea here was to encourage the InDesign user to open a copy of the original document. But it could be made more strict: a beforeOpen event-listener uses preventDefault() to stop the user's open command and replaces it with one using the OPEN_COPY option. This is probably exactly not what the OP is looking for, but it would have the effect of preventing the user from editing a document. I could imagine something like being useful if you wanted to protect documents in certain folders.,
As for protecting the script itself: In my workplace, the application Scripts folder is off-limits to those who don't have administrative access. An event-listener script could be placed in Startup Scripts at the application level, so that the afterOpen event-listener is always created when the application launches.
Thanks, Loic and Robert Kyle!