I FIXED THE BUG AHAHAHAHA Finally FINALLY F I N A L L Y I made a tile engine that doesn't lag its head off the second the amount of tiles goes into the triple digits! In fact, this can handle quadruple digits!
So, what were iterations 1 and 2? Why is 3 so much better? Iteration 1 stamped each and every tile on the entire dataset down one by one. Needless to say, that thing lagged like crazy. Iteration 2 ironically has over twice as much code as this, it scans each on-screen spot a tile could be. This one has 2 seperate data sets: the entire map, and the on-screen tiles.