The 'numOfPipes' condition is quite useless because the variable is set randomly every act cycle.
I believe that was intentional and certainly not useless. It is used to vary the maximum number of and randomize the spawning of pipes (in an interesting way). Kind of a dual purpose usage, in a strange way.