I added a few things I'd like you to check. Is the past perfect possible in sentence 2? Thank you.

1)He is so tired that he soon falls asleep. When he wakes up he finds a loaf of bread and a jug of water beside him.
2) He thinks the water is drugged. Before falling he had counted (is the past perfect correct?) fifty-two paces and forty-eight after waking up. So he thinks that the circuit of the dungeon measures about 50 yards but he can’t guess its shape as there are too many angles in the wall.
3) He realizes he had just avoided death. He considers himself a victim of the Inquisition who was going to die as a consequence of moral horrors. He can’t sleep for hours but then he falls asleep after drinking drugged water.
4) When he wakes up he can see the size and the shape of his prison and realized that the pit is about half the size he had calculated.

1. Change "beside him" to "nearby." (You'd need to write "beside himself" and that's very awkward.)

2. He thinks the water is drugged. Before falling, he counted fifty-two paces, but forty-eight after waking up. ...

3. He realizes he just avoided...
I don't understand "moral horrors."
Comma after "hours" and add "the" before "drugged."

4. Commas and verb tenses -- where?