I'd be wary of going too far forward without it -- you don't want to paint yourself into a corner and have to deprecate a bunch of functions because you've created hierarchy-capable replacements for them, but keep having to support them forever because mods are already relying on them.
One possible approach that comes to mind is to change the Child ID to be a more general Node ID that can represent nodes anywhere in the tree. You can define the root node to be ID #0, and traverse the tree (preorder, postorder, breadth-first, whatever) to assign numbers to all the others. All the existing commands that take a ChildID and NifID would still work in basically the same way, but could operate on any node rather than just top-level children.
What would need to change, to implement that approach, is just the way that scripts learn what ID numbers are valid. Currently you have NifGetNumChildren, which provides one end of a range of numbers whose other end is implicitly zero. That could be changed to something like NifGetChildren, which would take a NifID and a NodeID and return an array listing the IDs of the node's children. Scripts would call it once with a NodeID of zero, then again with the IDs obtained from the first call, and so on.
If you'd rather avoid returning arrays, you could use a breadth-first traversal to produce the node ID numbers, so that sibling nodes are always numbered consecutively. Then you'd just need a pair of commands that return the starting and ending IDs of a node's children.
As for this, that could work.
The alternative I'd been considering was to have a series of optional short arguments tailing most NifSE functions, which could be used to specify children as opposed to the root. So it would be something like this:
(type:return) function short:nifID [short:childID] [childID] [childID] [childID] [childID]
So you could, perhaps, call this:
NifSetNthChildName "Blah" nifID 1 4
Which would set the name of child 4 of child 1 of the root.
The only reason I tend to favor my approach is because I'm worried about the indices getting messed up your way. I mean... that makes no sense, I don't see how they would, but I'm just concerned because when dealing with Nifs my code is very much an outsider-looking-in and I'm not sure I can ensure consistency. Not to mention when you add new nodes... that could get confusing very quickly. Though honestly, it already
can get very confusing very quickly in that case. As a general practice, I'd recommend not trying to cache childIDs for too long...