This mod is so much better than my own DeathChest mod.. I didn't even think about saving the crafting queue and I couldn't decide on how to handle inventories bigger than the chest itself. It never occurred to me that I could spawn multiple chests (I was thinking of making different sized chest depending on how many items the player had in their inventory).
Anyway, I tested your mod and it's working great but I found some stuff in the code that might (or rather should) give an error (A simple typo):
chestinventory ~= nill
nill should not be defined at all (since LUA's null value is named nil), wierd that it doesn't react to an undefined variable.
Also, you repeat a lot of code. The code to find a non-colliding position and spawning a new chest is repeated several times in the code, why not make it a function instead?