I’ve just put online a small blog post describing how to write a scheme script which modify all the TeXmacs documents in a given directory, e.g. by replacing all the tags of one kind with another. I think this could be useful to others too:
https://mgubi.github.io/docs/zettels/scripting-webpages.html