With the Javascript it's actually not that bad. There is a bunch of code at the beginning for KC/TR that I have ignored until now, but that's just one block that you take or leave depending on KC/TR in the deck.
There are the preprocessed functions at the beginning which one could just also always take, or we don't do preprocessing anymore, as in the stripped function it will have no benefit, once it works.
Ignoring these two (solvable) points, you have to process the last important line of JS, where the array is constructed. Splitting it at "," almost really works, there are I think only 6 lines (of two different types) where it fails because there's a comma in a function. If you don't care about them (I tried JoaT vs Wharf, where you don't have the problems), my (say) 10 lines of code already work.
The long time problem is of course to keep this parsing up to date if the actionPriority changes, and to notice errors once they occur.
PS: Have not read danshep in detail, but that also sounds interesting.
Edit: In short what I want to do, as I now really now what it is:
When generating a new strategy in play.coffee, to define the actionPriortiy of this bot, I want to take the actionPriority-function from basicAI.coffee, and delete all lines from the list that are not used by the bot (not listed in "requieres"). This can work as you can handle the function as a string, but it's already Javascript and not Coffeescript anymore, especially they are now all in one single line, seperated by ",". Problem is that this seperations are not the only ","s in the string.
Edit2: Perhaps I should parse the string lowlevel char for char. Then I can just count braces, or handle them recursively, which is not really difficult as I don't have to understand anything and just identify the parts between two "real" ","s. And performance should not be important at this part, because this is only done twice per run.