You can comment out the activate and the problem persists.
Its that there doesn't seem to be any menubars exposed in this context.
This script displays 1 when run from the script editor, but 0 when run as a toolbar script.
Code:
tell application "OmniFocus"
tell application "System Events" to tell process "OmniFocus"
set x to every menu bar
set y to (count of x)
end tell
end tell
display dialog y
-P