Validation by checking a particular field on each row versus the last row

Forgot to mention, this is running on a mass action - I believe part of the problem is this is looping a lot of extra times.