Sam might not have enough space to move around, but the energy beam mesh as dense as it is in the tunnel, still left a few gaps on the floor, the walls and even in the air.
These gaps are enough for his pins to move around. If he is moving them solely with the help of his spiritual energy or even wind energy, then it would be a bit troublesome. However, his metal element has magnetic ability.
He can control these metal pins as easily as using his fingers.
First he focused the metal pins at only one area. They created a small formation in a gap where the energy beam density is relatively less.
In that spot, only one beam is close to the formation while the rest are a bit far away. To test something out, he created a very small, but extremely refined energy gathering formation.