The easy solution? Play it out, like the NFL. A defensive foul doesn't stop play until an offensive foul, violation, out of bounds, change of possession, held ball, offensive timeout, or made basket (does that cover it?) At that point, the offense is given the option to take the result of the play, or accept the foul (clock will go back to the time of the foul if the foul is taken). Foul will be charged to the fouling player regardless. If multiple defensive fouls take place, the offensive team may accept one of the fouls, or take the result of the play and charge the foul to the fouling player of their choice. Obviously this won't work for the last two minutes of the game unless we want to get rid of the take-a-foul strategy, so the last two minutes would be the same as current rules.
This would mean that a take foul on a breakaway would result in typically, a layup plus a foul accrued. No reason to do it if they're just going to score anyway AND you get the foul.
Of course, this would result in the proverbial "free play", which, if there isn't an obvious lane to the basket would clearly be a three. So, if that's too generous to the offense, maybe the offense gets five seconds of continuation to take a shot within the context of the play being run. But that's kind of subjective.
This would mean that a take foul on a breakaway would result in typically, a layup plus a foul accrued. No reason to do it if they're just going to score anyway AND you get the foul.
Of course, this would result in the proverbial "free play", which, if there isn't an obvious lane to the basket would clearly be a three. So, if that's too generous to the offense, maybe the offense gets five seconds of continuation to take a shot within the context of the play being run. But that's kind of subjective.