This script should do the trick:
Code:
tell application "OmniFocus"
set mainWindow to front window
set frontID to id of mainWindow
set background to (every window whose id is not frontID)
repeat with thisWindow in background
close thisWindow
end repeat
end tell
Shamelessly derived from troyb's script to merge OmniWeb windows!