like a quick sketch in a new medium it's not perfect, but here's a script I cobbled that I think almost does what you want ( you still have to press enter once per curve and it exports AI files) you can use it as a base for yours...