This line sleeps for 3 seconds for every user you are messaging:
eg. messaging 200 students = 10 min wait.
This is a common use case and has problems with load balancers which can be configured to cut off idle connections after a set time.
From looking through the commit history, there is no clear reason why the sleep was introduced. It also looks like the 2.0 email plugin doesn't have the sleep.