You need to get rid of the INIT at the top of your task, the starting index in the FOR should be V600, add a BREAK inside the loop when a C bit is true, and on the rung past the NEXT, add a MATH Result: V600 Formula: IF(V600>=664, 600, V600).
You will probably need to make some changes in MAIN, but this should get you on the right track.
BTW: You could change your comparative contacts to normally open contacts to simplify your rungs for readability.