My first step would be to contact the ISP and see whether
they are willing (perhaps for a fee), to solve this 'problem'
at the MTA level, by using a throttle. That's a far more
flexible solution, that avoids clutter in your programs as well. It also automatically solve the problem of having two
programs simultaniously trying to set a large batch mails.
You also don't have to reconfigure your program(s) if you and
your ISP agree on a different limit of mails/hour.
It's an MTA level problem, and that's where it needs to be solved.
Abigail