For items and stuff, and I think this can also apply to switches and gates, you can make a copy of the tilemap into free ram somewhere.
Like, say, your map is in GDB1, it's 12*20, and 240 bytes. You would say:
Copy(GDB1,L1,240)
and then your tilemap is in L1, and the next time you run the program, the map is restored.