I've been facing the same problems.
My diagnose is that whenever impressions are zero the script brakes. And that is a big problem because that's what I want the report for, to detect problems with impressions (among others).
For instance, yesterday I tweaked an account. As a result, enhanced CPC brought max CPC to 0.01 killing impressions (still don't understand why enhanced CPC does that sometimes).
This morning the script was not sending any emails, so all is fine, right? Nope! the script was breaking because that account had (almost) 0 impressions. And the worst thing is that when it brakes, it doesn't process the remaining accounts.
Right now I'm checking the code (hate doing that). If I find the solution, I'll share it here.
Thanks,
Xavier