Script takes time

I want a script which removes any mounted image (like dmg files or iso files) but not CD/DVD drive or USB drive.

I wrote this:

tell application "Finder"
	eject (every disk whose ejectable is true or local volume is false)
end tell

The script above removes my USB drives.
Secondly, It works fine when run from Script Editor but takes a lot of time when run using a hotkey from Butler or Quicksilver. Any idea as to why this happens?

The answer to your first question is that a USB drive is not “local”. Local refers to drives on the internal busses of your Mac.