String params;
if (params = e.serviceRequest()) {
params = params.substring(1,99);
e.serviveRequest() returns a nice pointer to char. Why do you insist on creating a new String every pass through loop? What do you think happens to them at the end of loop?
I'd suggest that you put a Serial.begin() and Serial.print() call in setup(), to see if the long wait is because the Arduino is resetting (as I suspect it is).