The script doesn't know it's you and you don't want to lock the fields...
What you can try to do is disable JS, add the code, save the file, close
it, and then enable it back again.
But you need to think carefully if this is really how you want it to work.
Imagine if someone opened the file, filled-in some fields and then wants to
save it and come back to it later on. They'll save the partially filled-in
file, and then they'll be stuck because all the fields are now read-only...
Not an ideal situation.