Agree if R accepts the penalty for the illegal kick, the spot of which was in the end zone, it is a safety. 2 points for R and K free kicks.
If K recovers the kick on the 5 yard line, R has the option to decline the penalty and take the ball at the 5 yards line, as K failed to make the line to gain on 4th down.
The status of the ball during an illegal kick is the same as before the illegal kick, which was a fumble as the ball was loose due to the muffed snap. If K recovers the kick on the 15 yard line, if R declines the penalty, it will be 1st and 10 for K at the 15, as they made the line to gain on the play. R will obviously accept the penalty for the illegal kick in this situation.