Although noise is something more commonly associated with audio, there is a graphical equivalent too. If you think of the term "white noise", it usually refers to randomly ordered white speckles on a black screen; noise in general is the same, except based upon existing colours as opposed to just white. Much of the algorithm for noise is the same as greyscale: cycle through each pixel, get the red, green, and blue value for it, add or subtract a small amount from each number, and set the new value. Of these, you should already be familiar with items 1, 2, and 4.
Compared to the greyscale() function, there are only four new lines of code, so most of it should be easy. The new parts - the lines using $modifier - are there to randomise the colours a little bit. By randomly choosing a value between -10 and 10 and adding it to the existing red, green, and blue values for a pixel, the function will either lighten or darken each pixel just a little. As each pixel will be randomised separately the whole picture should look a little different each time.