That's a really good and space saving idea!
It would also be a great way to store any kind of game on the DS cases. you just cut all of the holders, cut out the cartridge shape on the foam and super glue it... Don't know if it'll actually work but in theory it does