edit function for high ping

https://drive.google.com/file/d/0Bxq9Ym3e0mk-bXptQXRXX2JCYkk/view

Can I make a change of this function to test a more than 1 peek? At least 4, because maybe ping is 24ms,23ms,222ms,10ms, and alert me. I want to have alert, yeah, but when high ping is at leasst 4 passes.