I don't believe the TD would stand for any scenario if A illegally touches the ball in the end zone. 6-3-11 states that this is a special case of illegal touching and a violation is not canceled by any accepted penalty(only for offsetting fouls).
This is a goofy rule - but we need to understand the spirit of the rule to properly enforce these plays. The spirit of this rule was to be able to tack on A fouls when the play results in a touchback, or use the 20 as the PSK spot for B fouls when the play results in a touch back.
For example: Team A illegally touches in the end zone and downs the ball at the 3. During the kick there was a personal foul by A.
If we didn't have this rule, we would have to decline the personal foul and take the illegal touching spot at the B20 to give B 1/10 @ B20. If the foul was enforced, it would be B 1/10 @ B18. So essentially the PF goes unpunished.
Same with PSK. If we didn't have this rule and there was a foul on B instead of A, we would have to enforce it from the B3 (end of the kick)... so the illegal touching would essentially go unpunished.
Since we do have this rule, we can accept the foul and use the 20 yard line as a basic spot in those scenarios I have given.
In the original play in this thread, since B is not getting the ball at the 20, we WOULD cancel the illegal touching with the accepted penalty.
Does that clear it up at all?