That’s a cool implementation. I haven’t actually tried placing them on top of each other like that.
For updating the flags you’ll actually want to use Foundry’s setFlag() function. This is present on the document object of the tile.
Here is an example:
canvas.tiles.get("id of tile").document.setFlag("terminal", "enabled", false)
Let me know if that works better.
I am eventually adding a feature to open other Terminals. It’s good to hear there will be some demand for that.
EDIT: this feature has been added by the name “Secure Shell”. There is also included compendium macros that can be used for opening a Terminal.