If you're writing a private bot, just inject a damn DLL. You lose nothing in terms of security if you're already calling engine functions remotely, and you gain exponentially in terms of functionality and ease of development.
For public bots it gets more complicated, but if you're writing a public bot you've already got bigger problems.
Thank you for saying that, because I was just about to lose it (at the n'th poster thinking that injecting ASM is somehow staying "out of process").