Is there a way to reuse the same instance of the script, not spawn two instances, and some how have the script know which restriction it was called from?
Not sure if this helps, but maybe you could try to implement your policy server as a standalone network server instead of calling it through the spawn service.
Cheers, K.