The sound of metal pins could be heard because the sound of the hammering will vibrate through the solid particles in the moon. Say you had a metal rod going into the moon, and you pressed your ear against this whilst the hammering was done, the sound would travel through the pins, into the moon, into the metal rod into your ear.
The thing with sound in space is, it doesn't travel through space, but it travels through solids in space, if you get me?