Trice is a Twine 2.x (Sugar Cube) wrapper for Kate Compton's generative text JavaScript library Tracery. With Trice, you can author Twine stories that use a grammar to generate text in a number of different ways, including generating a grammar from specially-marked Twine passages.
Trice's Github page (opens in a new window). Trice is written in JavaScript.