When run by the applescript I get "execution error: Adobe Illustrator got an error: Error 30: Illegal 'return' outside of a ->" in the terminal. When I ran the script from illustrator I got "Error 30: Illegal 'return' outside of a function body." That is from within the "try" statement.
EDIT: waitaminute.... I can put the whole thing inside of a function and see if that works.