Folded executable from file

Is it possible to have the contents of an executable script (like TikZ or XYpic) be put in a script? That way I can edit the script with an external program, and then tell TeXmacs to update when I’m ready.

Two ways come to my mind (more maybe are possible).

  1. you use an \include command in LaTeX and include the actual code you want to typeset.
  2. you write a scheme procedure to read the content from the file and put it in the document at the right place. This is a bit trickier, I guess, but more fun.