In determining the damage done to you during a fast collision, probably the most important quantity to consider is the kinetic energy dissipated in your body.
For example, in a perfectly elastic collision, the hammer would have to bounce off you, the way bullets bounce harmlessly off of Superman, leaving his body totally intact.
If you make a rather stupid model of your body as a bunch of point-mass cells connected by springs, but the springs break if stretched past a certain point, then we can consider the number of springs broken to be a measure of the damage to your body. It takes a certain amount of energy to stretch the springs far enough to break, so the more energy dissipated, the more damage.
This isn’t the whole story, of course. For example, if I dissipate the energy of the sledgehammer impact over my entire body, I may not have enough energy density anywhere to break any springs, whereas if I put that same energy in one little place I could break all the springs there. So the cinder block may assuage the damage by spreading things out somewhat.
I think the most important thing the cinder block does is absorb a lot of energy. We can figure out how much by assuming all the collisions are inelastic.
Without the cinder block, all the energy of the sledgehammer is dissipated in your body (your body does not pick up any kinetic energy because the floor you’re lying on keeps it from moving). For a sledgehammer head of momentum and mass , the energy dissipated is .
If the hammer first collides inelastically with the hammer, then the momentum of the hammer and block is the same, so the kinetic energy dissipated is now , with the mass of the cinder block. This is smaller than before by a fraction , so that if the cinder block weighs nine times as much as the head of the hammer, then only one tenth as much kinetic energy gets dissipated in your body.
(I seem to have changed the target of the sledgehammer’s wrath from “the professor” to “you”, a somewhat aggressive move I swear was unintentional.)
As for the bed of nails, there’s just a lot of nails. If you can balance on tippy-toes, your contact area with the Earth is down to a few inches, but you can still manage that pressure. If the nails are an inch apart and each one has an area of at the tip, you get a few square inches of surface area out of that. By the way, it isn’t easy. It hurts.