You really had some free-time there =D
Well I won't continue mine, I would never finish it anyway, but I thought about this MUI thing and thought about making "inventory pages". So basic you create an addition icon at the inventory view, which allows you to switch the inventory page.
If one player selects a unit then the inventory for that selected unit should be open. Now if the player select another unit a hidden inventory page is created for that unit. by clicking on the addition icon, he can switch between all opened and hidden inventories and closing them by pressing esc or the x.
The thing is you just have to make something like a queue, so the 1 inventory belongs to the first selected unit and the 2 inventory to the second selected unit and so on.
Sounds weird but I'm not sure maybe it's something to work on.