This post has been marked by the post author as the answer.
Yes, simply add something like the following:
local U = require "utillib.lua"
in _main function:
if U.PlayerCloserThan( e, 100 ) then -- change the 100 to suit
HurtPlayer( e, 1 )
end
Been there, done that, got all the T-Shirts!