That could mean there are a huge amount of events to process when you specify a couple of days.
And possibly the vCenter can't cope (server load, DB load...) or the client where you run the script can't cope.
Running the script over a longer period of time with the PSP debugger switched on will put a high load on the client where you run the script.
You should be able to see that when you open the Performance Manager on the client.
Did you try specifying a short time interval, but one where you are sure there was a snapshot and a revert ?
That will allow you to at least test if the functionality of the functions and the scripts work.