I think that sample code comes from mod/choice/modform.php, where ->_instance is defined.
the effect of that code is, if you are editing an existing choice, you get one repeat for each choice defined so far, plus space for two more. If you are creating a new choice, you get 5 repeats.
Actually, in the question forms, we eventually worked out that the +2 thing is more often a pain, and a waste of space, than it is a help. It is better to show exactly the right number of repeats when you are editing an existing thing. If people really want more, they have to click the button, but it is much more common that people are editing an existing thing, and don't want extra blanks.