But I wouldn't to use a loop for this. I want something like:
On touched tilemap & tilemap.tileTouched = false> tilemap.tileAt(something.else.that.I.don't.know): set tilemap.tileTouched = true
Not sure if Tilemap would be able to do that, but you could try compare tilemap at mouse.x mouse.y if touched = true or false, but again you would have to be able to check each tilemap block individually
An array would work well to have a value for each tile. Just make it's size the same as the tilemap's number of tiles, horizontal and vertical. To find if a certain tile is touched you can use the expressions in the tilemap to convert the touch's x and y to a column and row.