Identifying the level of menu items in the item array?
I'm not sure to understand your problem, but as you define everything by code, it should be straightforward.

You can create any menu entry you want, on any existing or newly created entry.

As for the hierarchy, you just have to define your paths like any URL path. As per the doc :
If you have

function mymodule_menu() {
    $items['abc'] = array(
      'page callback' =&gt; 'mymodule_abc_view',
    );
    return $items;
}


You can then define a child entry like this :

function mymodule_menu() {
    $items['abc/def'] = array(
      'page callback' =&gt; 'mymodule_abc_def_view',
    );
    return $items;
}


This will give an entry at the root level 'abc' and a child entry 'abc/def'.

HTH.