I tweaked the original script similar to zagdul above. Here it is:
on alfred_script(q)
set theName to (q)
set isRunning to false
tell application "System Events"
if exists process "OmniFocus" then
set isRunning to true
end if
end tell
if isRunning is false then
tell application "OmniFocus" to activate
end if
tell application "OmniFocus"
parse tasks into default document with transport text q
end tell
end alfred_script