I ended up doing that, but it took up such a large amount of time that I didn't do anything else. While it's nice to have it working better than the hack I had originally drafted, I wish I had gotten further on my main project.
The cool thing I have to note, is that the little demo uses AJAX and I didn't have any references for it around or on my laptop. I browsed Xml+Http ProgID's in the registry and for some PHP stuff I looked in php5.syn (a syntax highlighting file for TextPad). That felt pretty good.