How to quit Trim Enabler?
You can use AppleScript to send the application a quit Apple event:

osascript -e 'quit app "Trim Enabler"'


Quit Apple events are also used by loginwindow to quit non-Cocoa applications when you log out.

If that doesn't work, killall Trim\ Enabler is probably also safe. It sends the process a TERM signal, which usually allows a process to terminate cleanly.