Hello,
An Error such as that is usually caused by your code causing one of your rules to run in a loop over and over again. If that's not the case you could try checking the properties of your field and see if the "Refresh value when formula is recalculated" check box is ticked. If so, try unchecking it.