I think you need to use a high density fiber board or something like that... something thick and heavy 3/4" not sure I would use something so messy as expandable foam...Might even run into heat issues though I don't know with all the air moving through, but what if a fan failure then you got to real mess to deal with may as well throw it out and build a new. My Opinion, be best to glue that egg carton looking foam to the inside of the box then hang the heavy box from a couple of ceiling joists.... very securely and hang your fan from bungee inside the box.. never done it but if I were going too, I think this is what I would do.