I have no prior knowledge of how this system is programmed, but as a programmer for over 20 years I would do it at chest open. From a programatic point of view there is no need to ID the actual content of what is in the chest until someone opens it. When it drops, the program would need to "mark" the chest with different variables (i.e. Named NPC or not, what level NPC, etc etc). Hell, as I write this I changed my mind 3 different times. It could be done at anytime it's 100% up to the programmer(s). As with almost anything, there is more than one way to skin a cat.