That logic is sound, the Mumakil actually uses it in the exact same way that Generals did. You may need to check the bone names though.
The tricky part is the entering/leaving of units from structures (i.e. correct garrison logic) as the code has been changed due to the fact that players mainly control hordes rather than single units - and they craftily changed the hardcoded bone names for that
