It would have to be significantly shorter than a lot of other spells have been shown to be (able to engage in ground-to-air combat against brooms) to be unable to target a person inside a building from outside it, or for a very large building like the castle of Hogwarts, at least from several rooms away.
Ordinary sniping relies on large amounts of distance between the shooter and the target to prevent them from being noticed and avoided or attacked. Moody could just rely on having multiple walls between him and his target.
Perhaps it has a range limit.
It would have to be significantly shorter than a lot of other spells have been shown to be (able to engage in ground-to-air combat against brooms) to be unable to target a person inside a building from outside it, or for a very large building like the castle of Hogwarts, at least from several rooms away.
Ordinary sniping relies on large amounts of distance between the shooter and the target to prevent them from being noticed and avoided or attacked. Moody could just rely on having multiple walls between him and his target.