If there was a barrier on the cave that only allowed human children in, how did Nicodemus get in?

Back door.

Actually, given how quickly he arrived, I'd suppose that he had some kind of magical short-cut. At the time, I kind of assumed that he was lying in wait in the shadows, and alerted by the clang of the sword falling on the ground, but since then we've discovered that he has a throne to keep him busy elsewhere most of the time, and he likes to leave tripwires on his treasures.

Also, Nicodemus may have been responsible for the barrier spell in the first place. He wouldn't let humans in though, so either that theory is wrong, or he simply can't keep them out for some reason.