You could probably write a function for this, but I usually do something simpler. I use a key macro involving the ^A and ^X keys (increment and decrement a number). Use qa to start recording, do your stuff, using those keys with count modifiers (e.g 18^X), and just do say, 10@ afterwards.