Hi,
This line sleeps for 3 seconds for every user you are messaging:
message/lib.php:1002: sleep(3);
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.