Had an unusual one on Saturday. 80 yard run for a TD. Runner is far ahead of everybody. At A's 40, a B player clocks an A running alongside him. Trailing as the R, I flag it. At B's 40, a different A player clocks a B player running alongside him. I toss my second flag. All this happened before the runner scored so I have two liveball fouls. If I'm correct, by rule I should have taken the ball back to the original LOS and replayed the down. But after thinking about it for a moment, that would have been rewarding the defense for fouling because if they didn't foul we'd enforce a 15 yd. penalty from B's 40 and give A a 1st down at A's 45. If I offset them, we're back at A's 20 and replaying the down.
The only fair thing I could think of to do was to bring the ball back to the spot of A's foul and offset the penalties from there. I'm pretty sure I got this wrong. What should I have done?