Repeat until sensor value is accepted does not work.
The loop does stop but you can not see it: You should add a brake block after the loop that runs until colour sensor&lt;20 otherwise there is no visible indication that the loop has stopped. Hope this helped.