I've never heard of anyone actually insulating with foam on the inside of a tank, but I'm sure it's been done. I personally wouldn't use foam inside the enclosure. On the bottom and maybe the sides, it will easly become soiled by the snake's poop and pee.I don't think the UTH would burn the foam if you are regulating it to the proper 88-94* temperatures on the warm side with a dimmer, rheostat, or a thermostat. However, it's not something I'd personally want to figure out on my own.
If I read correctly, are you trying to say that you are using paper bags to basically regulate the temperature from the UTH? If so, that is really not going to cut it.
My advice to you is to:
1) Ditch all the foam or at least move it to the outside of the tank.
2) The only way to keep the UTH from getting to hot is to invest in a device to regulate it. Before I got a thermostat for mine, it reached temperatures of 114* and that is WAY too hot for a BP. That is why your snake isn't going into his warm hide. If you can't afford a thermostat, you can get a lamp dimmer from Home Depot or even a manual type rheostat from most pet supply stores.
3) Instead of the foam, do a foil treatment on your lid and follow this tutorial.
http://ball-pythons.net/forums/showt...um+foil+screen
This is exactly what I did to my tank, except I only left one opening instead of two. Before I did this, I had the same problem with not being able to hold heat or humidity in my tank. Now that I've done the foil treatment on my screen cover, everything is great.