The character who points a sword at the shepherd's forehead is the alchemist himself. He was disguised as a horseman and wanted to test Santiago's bravery and faith, which is why he did that - drawing a bit of his blood in the process. Santiago didn't show fear when this happened, which is why the alchemist accepted him.