Carlos,
Is an applescript-based solution required? Without reviewing your code, I'm guessing Applescript is necessary to send commands to the Evernote app to open notes and such.
I'm asking because there is an Evernote plugin for Sublime Text 3 that I use which finds notes from a specific notebook without any problems:
https://github.com/bordaigorl/sublime-evernote
The plugin is written in Python, and I believe it makes calls to the Evernote API instead of communicating directly with the desktop application. So, perhaps this comment isn't of any use at all to you, but I wanted to share it in case it would help.