This script toggles locking of record(s) and file(s). To prevent confusion I think it’s a good idea to add a marker that shows that the underlying file is locked, but I don’t know (yet) if and how you use e.g. labels. A tag could be used as marker too.
-- Toggle locking of record(s) and file(s)
tell application id "DNtp"
try
set windowClass to class of think window 1
if windowClass = viewer window then
set theRecords to selection of window 1
else if windowClass = document window then
set theRecords to content record of window 1 as list
end if
repeat with thisRecord in theRecords
set thisPath to path of thisRecord
if locking of thisRecord = false then
set locking of thisRecord to true
tell application "Finder" to set locked of file (POSIX file thisPath as alias) to true
else
set locking of thisRecord to false
tell application "Finder" to set locked of file (POSIX file thisPath as alias) to false
end if
end repeat
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
end try
end tell