Yeah, I agree, your method of creating objects is not optimal..
Adding more precise conditions would be a lot better..
A For each block create a new block isn't really working..
Adding a trigger would work much better, Then it would only do it once and when needed..
Although I'm not quite sure what you are trying to do here, so I can only react to the code and not your intentions with it..