The class TileMap, and its TileSet resource, have several properties and functions to be used from script, including:
You can refer to a tile with its Id (which is unique) or the name you gave it when creating it.
You can exchange one tile for another or delete it. You can change entire groups if you use this in a loop or you can generate random tiles -> procedural maps!
You can pass world coordinates (pixels) to tilemap coordinates (tiles) and vice versa for example, to detect in which tile is the mouse pointer.
The tiles can carry collisions, navigation, etc. You can also animate them, but I don't know how, one way is with an AnimateTexture, for example to show the frames of a block that is breaking. I believe that with TileMaps you can do what you want, and obviously combining it with other godot nodes for specific parts like static bodies as you said. Study the TileMap and TileSet documentation and search godot tutorials with words like terraria, minecraft, procedural maps etc.