I agree about appleScript. Probably the best practice would be to try to implement the same commands and behavior as Safari and/or Chrome.
Might I also suggest as a resource for you in the implementation:
The site is run by a couple of mac automation experts and there's a lot of AppleScript experience among the members.
There is an ongoing discussion about scripting Orion, and issues with getting results from specific commands.
Hope that's helpful