Code:
-- Finds a Task
-- _id : tracid of task
on findTask(_id)
tell application "OmniPlan"
tell first document
set t to first task whose value of custom data entry "tracid" is _id
if exists t then
return t
else
return false
end if
end tell
end tell
end findTask