You could use jQuery and rerender DOM elements containing code, but honestly, you really shouldn't be using Sugarcane. The web is a much different place, and Sugarcane is not being actively supported or worked on by anyone and is, at this point, pretty outdated. You can stick with Twine 1 if you prefer it; I do as I like being able to have multiple passages open at once, and I use a few other Twine 1-only features. If you do, just download and install the Twine 1 version of SugarCube 2, and experiment with its DOM macro set. You could also, obviously, upgrade to Twine 2, which includes a slightly old version of SugarCube 2 in the most recent version, but you'll probably want to update SugarCube anyway.