If you managed to understand the improved pixelate algorithm, blurring an image will not be a problem as it follows almost exactly the same procedure. To blur an image, you need to iterate through each pixel in a picture and read the colour value of all pixels surrounding it. The new colour for each pixel is an average of its own plus the colours of those around it, however we need to set the colour of each pixel individually rather than just using a filled rectangle as in the pixelate algorithm.
As you can see, that is almost identical to the pixelate function. The differences are that each pixel is looped through individually as opposed to incrementing the loop variables by $blocksize. Also, note that the $dist variable is used to decide how many adjacent pixels should be read. In the example above, $dist is set to 1, which means the algorithm averages the colour values of the current pixel, as well as the pixels immediately above, below, left, right, above-left, above-right, below-left, and below-right. Increasing that to two will read the values from the two pixels immediately above the current one, the two to the left, etc.
Below is image produced by running my test image through the blur effect.
My test image was 700 pixels wide by 400 high, making a total of 280,000 pixels. With $dist set to 1, PHP will read average nine values for each pixel, giving a total of 2,520,000 pixel reads. Once you add into that all the looping, dividing, colour allocation, and array manipulation, it should become clear that blurring an image is a very slow process and not one you want be do doing each time a page is requested. Just increasing $dist to 2 will make the script take a lot longer to execute.
However, there are benefits to increasing the $dist value. For example, the larger $dist is, the more blurred the final image is. The reason for this is because a large block of pixels is averaged to get the colour for the same one pixel, which means it is less likely to have its original colour. For sufficiently large values of $dist, the colour of each pixel will be calculated as the average of every other pixel in the image, essentially making the entire image the same colour.