How about this?:
The pitcher has now entered and is batting for himself (thus terminating the DH), but is batting out of order and, if determined while at bat, the proper batter (#7 in the OP) takes his place and assumes his count. If determined after the AB is completed, the proper batter (#7 in the OP) is out and the # 8 batter is up. In either case, the DH is terminated by the pitcher batting (out of order) for himself.