There is absolutely no reason you couldnt do a few simple optimizations to make it much faster.. for instance..

change this:
wait(1);

to something like this:
wait(5+random(10));

there are otehr ways to do it too.. but in general, the key is to spread out complex operations over time.. this is how you speed up all functions.