I haven't needed to work with repeating fields for ages. I need to work out how many repetitions a repeating field is defined to have. Specifically this is in a loop to work out when to stop. This seems to work:
IsValid ( GetRepetition ( Job::Risk_Survey_Physical_Q ; $counter ) )
When $counter > number of repetitions, isValid returns zero.
If there is a better way, let me know.
Hope this helps.