Either of these should work:
Code:
tell application "OmniFocus"
tell front document
set oTask to (make new inbox task with properties {name:"test", note:"test 2", flagged:true})
set strID to id of oTask
end tell
end tell
-- OR
tell application "OmniFocus"
tell front document
tell (make new inbox task with properties {name:"test", note:"test 2", flagged:true})
set strID to id
end tell
end tell
end tell