I don't know if you already write something about this, but,
if you don't may it help...
My idea is to say in the XPI "this script uses the Inkscape DOM"
and the inkscape will talk with the script all the time, allowing
this to use the inkscape like the user does...
The Inkscape must listen the commands from the script output
and write an feedback in a pipefile for the script know what happens.