As example I would like to show some questions:
Dynamically drawing trees, showing merge operations, or running simple TM emulator to show step by step what is happening would give another way to improve answers. It would be easier to understand concept and with low overhead it could turn answer into useful, interactive resource.
Any problems with this? I think that execute script on implicit request by user is must have starter. It could be enabled from some rep level and/or reviewed before accepting. I do not think that this would be overwhelming task, as this is first request and some questions are begging to be animated while others just can't.
It is security risk if: script is loaded and executed without interaction. If everybody without high reputation could use it, without revision and by enabling external sources. Everything could be managed and even more importantly it could be literally two embeded libraries executing only animations. Let me give example. User is given only access to Tree builder and Machine emulator. These libraries are internal, so there is no risk of external loading. User must have eg. 300 rep, and it is reviewed afterward to plug it in. Reviewing is not hard to this as there are limited capabilities and there are not many eager to write it.
BTW I today written RBT to make images. If user can only use script to add nodes to tree, what is the risk?
I know it is odd request and in pure form is out of question.