You need to put the peak-to-peak indicator outside the case structure so it gets updated every loop iteration. To retain the values for iteration that currently don't update the indicator, use a second shift register across the while loop which also goes throught the case structure.
In the TRUE case, the result of the division is wired to it's output tunnel. In the FALSE case, the output of the left shift register is simply wired across the case structure, retaining the old value. From the indicator, the wire continues to the new shift register on the right.