I found an interesting and weird detail: I started using this script in a rackspace with 4 Korg Triton Extreme plugins and the first time I did it it worked beautifully.
The first plugin went into sleep mode when inactive (I set 1 second for this option) and played normally when I activated it again.
However, as soon as I used the script for the second plugin, the problem appeared. None of these plugins activated when playing the first note.
Conclusion: If you use just one of the plugins, it works perfectly, but if you use more than one plugin, none of them work correctly.
Could this point to any solution?