61 I... may be on to something.....
Its far from good code but... it seems to run the correct lua function.
Additionally, I managed to overwrite lua's print function with something that puts values inside a special array on the php side so I can actually return printed text properly. That also means its now a bit better than lua's print function when it comes to debugging....(yes....that just happened)
I think I may also have sandboxed it properly, considering I accidentally manged to just strip out both lua's print function and my own in the process.... I just need to setup a timer to limit how long it is allowed to run (though, php scripts have a timer build in of 30 seconds).
And... of course make it so that the action functions know what they are actually targeting and who is using them....