I'd submit that telling him who he can text comes off as control. A boundary is deciding for yourself that you don't want to be around that behavior and then not inviting him.
I respectfully disagree, FP. A boundary is deciding for yourself how you will allow others to treat you. If he is in Train's presence -- either as a current H or an ex -- she has every right to decide how she will allow herself to be treated.
I'll use an example of an off-color racial joke. If Train's H told one in her presence, and she found it repugnant, she has every right to say "I don't find that funny, and I would appreciate it if you don't tell jokes like that in my presence. She shouldn't make HERself leave the room?
I agree with the rest of your post about treating a wayward spouse as an ex -- that's spot-on.