Interesting article. It seems to me like what you really want here is to do this in a lisp/scheme. Then you can use the full power of lisp (it's the exact same syntax as the behavior tree), leverage lisp's built-in control flow constructs, and just implement nodes as functions with side-effects that return either true, false, or null or something.