At a dressage event, you will be watched by a judge and a penciller. The judge watches and judges you, and the penciller writes down the numbers and comments for each movement, hence the term "pencilling". The judge must sit and watch the horse, and thus can't write down anything, really, which makes pencillers very important. Pencilling should only be attempted if you can write fairly quickly, with a neat hand and can remember numbers and phrases easily. Ideally you should also know at least a little about dressage, as that will make it easier to remember and keep track of what is happening.
In addition to writing down everything the judge says, you'll likely have to ensure you are judging the correct horse and the right time, the judge knows which test is happening, and that the judge knows which movement is meant to be happening. This means you should keep an eye on the test, which is difficult at the higher levels, but if the judge gives you a comment on a serpentine when the rider is actually doing a loop, you'll have to inform them. Most judges are good judges, and so you'll work as a team.
It takes a little getting used to, since you are often a movement or two behind the judge, especially at the higher level tests. Memory multitasking is a big thing here. Every judge has a slightly different style and turn of phrase, and if you spend some time pencilling for one judge, you might find yourself having some difficulty getting used to another's style.
You will also have to learn certain shorthand phrases, such as "trans." for transition and "imp." for impulsion. Center line is generally written as CL, and fractions are written as numbers. These should be logical, since the rider will read those comments afterwards, and they will need to understand them.
Pencilling is a great thing to do if you are unable to ride for whatever reason. It has a behind the scenes feeling to it, and you get to watch many riders and find out what they do. Generally, if you are riding in a competition you focus so much on only yourself that you never find out how others do. Sitting next to the judge is like getting a mini lesson in what not to do. You also get to gossip about different riders or clubs.
While some clubs do nothing at all for their pencillers beyond a thank you, some will supply free food of some sort, and others will even pay you a small amount for petrol or your time. It's a great way to meet new people and make more contacts in the horse industry, and to help your club keep going.
Tem42 informs me that this is not a practice exclusive to dressage, and is done at other sporting events.