Your code can be simplified if you’re just trying to check if a file has a certain tag.
tell application id "DNtp"
if (selected records) is {} then return
repeat with theRecord in (selected records)
if (tags of theRecord) contains "pdfs" then
add custom meta data "Journal" for "Format" to theRecord
--- And/or do other stuff
end if
end repeat
end tell
This line could even be a one-liner without the need for a closing end if
…
if (tags of theRecord) contains "pdfs" then add custom meta data "Journal" for "Format" to theRecord
As a continuation of the lesson, you could even use this syntax to pre-filter the items to loop through…
set tagMatchedFiles to (selected records whose (tags contains "pdfs"))
repeat with theRecord in tagMatchedFiles
add custom meta data "Journal" for "Format" to theRecord
end repeat