I am not talking about storing objects as local variables. I know that wouldn't work. I meant that, if the underlying Bioware DB allows storing items (like creatures and magic bags) that, themselves, have inventories, then adding object storage to the NBDE system should be doable by storing the item as an item in the NBDE item's inventory.
Of course, I could be misunderstanding what NBDE is doing. My brief peek gave me the impression that NBDE takes the variable name and value that one wishes to store to the DB and (with some hashing) stores it as local on the special DB item (the one whose resref is nbde_database). It can do that for many variables (a whole database's worth) because one can store many locals on the item. Then (eventually) it uses StoreCampaignObject() to write that DB item to the Bioware database for persistence. It does this for ints, strings, floats, etc. because those call all be stored pretty easily as locals on the DB item. It doesn't allow storage of objects because, as you say, SetLocalObject only stores the reference to the object, not the whole object itself.
However, I think the underlying BW database allows storage of objects that, themselves, have inventories (like creatures). So, imagine that the NBDE item is set to be a container. Then, the NBDE system might be expanded to include storage of items by simply creating a copy of the item in the DB item's inventory.
My proposed expansion depends on that assumption about the sort of items that can be stored to the underlying database. If it is not possible to store items with their own inventories using StoreCampaignObject(), then what I was proposing doesn't work.