Setting a variable to the result of a terminal command within an applescript
try:

set dontEject to {"Mac OS X", "Time Machine", "Media", "home", "net"}
set myDisks to list disks

repeat with aDisk in myDisks
    if aDisk is not in dontEject then tell application "Finder" to eject aDisk
end repeat