There actually is already a hit cooldown present, as long as the character flickers red after getting hit, you shouldn't be able to get hit again.
Have to say, I have difficult times reproducing the collision bug myself, even after getting hit constantly when right behind the wall.
Maybe I'll give it another look at it to see if it's possible again.