Bit of devils advocate here - if the penalty is not scored, an indirect free-kick is awarded to the defending team. According to your definition, the encroachment has been made when the game is not live. Perhaps it's more that when the ball is struck, the game is live, and the other attacking player is within the area.
That would be right, guess.