Possible Solutions
Two possible solutions come to mind at once. First, the data to be affected could be included as a parameter of the subnegotiation. in other words, the data is inserted in the data stream before the IAC SE that terminates the subnegotiation. The disadvantages of this solution are both theoretical and practical. Theoretically, it is improper and not really in the spirit of the Telnet protocol design to send data as subnegotiation parameters. Practically, in a situation where this case would arise it would be equally unexpected behavior (and perhaps confusing if a human was affected) if all data except that affected by the subnegotiation was flushed.
The second solution would be for designers of options which have such subnegotiations define a subnegotiation or other mechanism that would follow immediately after the Data Mark and nullify the affects of any offending subnegotiation. The exact semantics of such a subnegotiation would probably be very specific to the option.