If that was my snake & cage, I'd put some folded corrugated cardboard in that space so he cannot keep doing this. Snakes do occasionally hurt themselves
seriously because they can be clueless about what they can fit through. In the wild, they get stuck & die in 'bird netting' & chicken wire used in gardens, for
example. (-in those cases, their directional scales hang up & they cannot back out, they get stuck halfway) It's possible (?) that he's smelling 'fresh air' from
the opening there and is convinced he can get out. (I've put a snake on the floor & had them head to the closed sliding glass door time after time, drawn to
the bit of outside air coming in through the cracks...)