I couldnt reproduce your issue, but i was using your original code. Ill try with your gist.
one issue is that SpriteNodes take up resources, and it is not a good idea to have 10000 of them in a scene. Your code ran at about 3fps for me.. though i think the images i was using were larger than 20x20, so all the rescaling might be hurting performance too.
it seems to work well to render a single ground texture(which can be stored to a ui.Image, once), then just update bits as needed. This could be done prior to starting the scene, or even saved in a file for faster initial starting. It is not really necessary to try to do screen bounds checking, except maybe if you start getting into really huge maps, but in that case it makes more sense to divide the map into "zones", and you would only ever be showing the 9 adjacent zones to the current zone.
Here is a version that operates at 60fps on my old ipad3 using this idea. themap was changed to an array of indexes, so you could still do things like collision checking with ground tiles of certain type. I render the entire map to an image/texture.
edit mode has a second of lag or so, because it still has to draw the original map, then draw a new tile on top, then convert that to a texture again. Dividing the ground into a small number, say 10x10 of chunks each containing a single texture of 10x10 tiles probably would speed that up even more.
i was lazy on the edit mode tile indexing, it works, but may be somewhat imprecise. probably need something like (xy.x+unit) // (2*unit) to match the center, not corner, of grid, but you maybe would want to draw the touch, and print the grid Coords to confirm.