Yes, but you need to keep the script running. For example,
file_to_lock := A_ScriptFullPath
locked_file := FileOpen(file_to_lock, "r-d")
MsgBox Click OK to exit and unlock the file.
; locked_file.Close() ; Optional when exiting.
"the path of your file". This example locks the script itself.
To lock multiple files, you would need to call FileOpen once for each file and store the return value in a different variable (or an array) each time.
If you want it to just sit silently until you exit it from the system tray, remove MsgBox and ExitApp and add