Is it possible to get a return value from a KWin script?

Yes you can use journal to catch the result, but a better alternative would be to send the result using callDBus to a service you register like this example I did in python Determine when monitor is turned on or off via python dbus - #7 by luisbocanegra

You may also find this project useful