I hope you noticed the edited code in the last post.
Anyway, if you were willing to change your procedure a bit one could get away with a one-stop-Script, I suppose.
You’d have to switch to Quick Mask Mode after making the first Selection, then make the second Selection and after that run a new Script.