It's funny few days ago @odolvlobo mention idea about adding script/programing language on Taproot's witness data[1], but it turns out some already doing it. Anyway, my opinion is such idea should be realized on side-chain instead.
I guess the flaw remains only in verifying the truthfulness of this information, and if there is a method decentralized and trustless enough to consistently verify the truthfulness of this information by any given party.
It's not that different with Bitcoin. People can do that by running software which verify and execute all script. In case of invalid script, the software just need to ignore it.
[1]
https://bitcointalk.org/index.php?topic=5452759.0