That should be possible, Ving.
The only thing you need to watch is the size and placement of the foam, and perhaps shape the edge closest to the hinge. That's just because of the way the lid closes onto the box (It is hinged below the top of the box, and the opening in the top of the box is a bit smaller than the lid, due to the folds they've put in to stiffen it.
If you use really soft foam you might be able to simply squash it closed.
I'm sure that if you are that way inclined, these are not problems that are insurmountable!
Al.