Some people feel branching is too slow, even for modern gpus, if so and you really want to optimize you can always change the branching to something like
bool ring = isRing(i.worldPos, _RingPositions[index], _RingRadii[index]);
o.Albedo = lerp(o.Albedo, RingColor, ring);
o.Emission = lerp(o.Emission, RingColor, ring);
Shaders can't change size of an array, so make the max the largest size you'll need. You also define a uniform int _RingCount
variable which syncs the current length, and instead loop over the current count rather than the max everytime.
If there are a lot of small objects and a lot of rings this can be a hit on performance, it may be better to make this a post processing shader and so only performs the loops once, however it'll be placed on all objects and not just ones with the material.