PerformSearchAndIterateOverResults

tell application "TaskPaper"
    tell front document
         repeat with each in search with query "project Inbox and not @done"
              -- do something with each matching entry
         end repeat
    end tell
end tell