That's scary when someone wonders "What would NJSteve do?"

Maybe I should get my own sign now?
I would probably figure out some way to dissolve the foam gasket into something 1/100th its size and then inject it into the area using a single tube Dunkin Donuts coffee stirrer (never use Starbucks, you risk a bad chemical reaction). Once installed I would then inject it with the replenisher agent to enlarge it back to its original size. Barring that ...I would take it apart again and put that stupid foam o-ring back on (BTW I have done that a couple time myself on A/C-equipped cars).
Good Luck with your project. I am happy to have the chance to entertain and enlighten.
BTW Part II: You don't really need that foam o-ring thingy that much. You could buy some 3M strip caulk and just feed a bunch of it into the gap around the heater core tube until you have sufficient amount on both sides to fill the space. The purpose of the foam is to keep out engine smells and moisture, and to keep the tube from rubbing against the metal of the firewall. You may want to try this instead of yanking the heater box out again and risking damaging the new heater core (been there, done that, too).