If your goal is to create a one time check for a value, use the first script. If you want to constantly check for a value, the second one is ideal. However, the repeat until true will infinitely loop (Yields the script) until the a condition is met. You may want to throw it into a separate thread if you don’t want it to yield, but still check in the background.
As for performance, the difference is minimal. A computer is not to be taken lightly, and the code you’re running is not heavy in any sort of way. It really just depends on what goal you’re trying to achieve.
Instead of the repeat loop, I’d probably fire a BindableEvent with a parameter and execute the if check within that event. That way, you won’t have to yield any threads and always have to loop. If ever you do need a thread to yield, you could use BindableEvent:Wait(), which stops the thread until the event is fired. Since it’s an internal function, it’s just slightly faster than coding it yourself.
Again, the performance is barely impacted in both scripts, it really depends on what you’re trying to achieve.