The specific example he uses will let you type any number, followed by hitting "q" twice, and will select that number of lines. Try writing "5qq" to see what it does.
The keybinding itself is built up of a regular expression to catch any number, followed by the binding "q,q". The command to be executed gets passed $1 as a paramater, which is the number "caught" in the regular expression.
The idea is, if you want to bind any command to accept a number before it, just copy this line and change the command from "expandSelectionTo line" to whatever command you want performed.