well the rule you have written is indeed an infinite loop because
let us say the original value is 4, 4 is less than 9 so you put the new value as 04 but 04 is also less than 9, so you put the new value as 004.......
a way around this would be to check the length of the field also. Check the attachment