You need to speak to your husband first: are you absolutely sure your marriage isn't salvageable with counselling etc? Flirty texts are not on, but don't need to be the absolute end of things, IMO. You did mention he was depressed and therefore not himself. Perhaps the attention made him feel good about himself. You say you haven't spoken about it since, which really means that you have totally failed to resolve the matter in your own head and are harbouring mistrust and resentment.
Addressing your concerns about splitting, Kimaroo is right: you'll wait until his GCSES are over, then it will be his A-levels, next it will be university and you won't want to upset him when he is away from home for the first time. I'd concentrate on dealing with things now, if I were you: you can't live an unhappy lie for several years.
Assuming that the worst happens and, after chatting and maybe marriage counselling, the worst happens and you split, it may not be anywhere near as awful as you imagine. As a teacher and form tutor, I can honestly say that I have been a tutor to something like 40/50 secondary age children whose parents have separated and you would be surprised at how well many of them do cope. Those that don't cope tend to have families where violence or blatant adultery is the cause, which causes them all kinds of feelings of fear, betrayal and anger. They feel helpless. Where a separation is more civil and amicable, they definitely do cope better. I know that isn't true for every child, but I can only tell you what I know from working closely with teenagers.
As there is no other woman for your son to have to see, you might find that he copes better knowing it is an amicable separation / divorce. The hardest thing for him will be the shock: as you say, you have been carrying on as if all is well. That's why I think you need to at least have a go at discussing the issues with your husband first.