You misunderstand the issue, the problem isn'T that it'S too resource intensive, it's that the condition can only be true once a frame, so only one block moves per frame, hence the perceived "lag"
Change your code so that all the blocks that need to be moved are picked and moved at the same time instead of one per frame