I know this probably isn’t the answer you’re looking for, but have you considered just upgrading his enclosure? It seems like you’ve had several issues with areas of this enclosure that are causing some injuries, or at least what you’re describing as injuries, and I’m not sure sticking foam all over it is really a permanent fix. Based on your other Instagram posts, and I may be wrong so correct me, that cage doesn’t look very big, and he’ll need an upgrade anyway. Probably wouldn’t hurt to start looking at 40-gallon breeders or a PVC enclosure at this point.
For the record, I really dislike suggesting someone drop a bunch of money on a new enclosure but based on your posts it seems like this one has caused you a lot of issues, so in my opinion it’d probably be better to just replace it. Especially if your snake is continuously getting hurt in it.