Someone told me that this might have been done already, but I couldn't find anything.
So here is patch for it: https://github.com/kmatheussen/libpd/commit/a6af47e002d5bc683df5bf3364bce20c...
Code is quite clean, but it uses some global variables to keep state while execution shifts between the wish process and the pd process. But I guess it could be difficult to implement it in any less confusing way...
For Radium, this is necessary in order to be able to copy and paste between pd objects [1], but it could also be a nice feature if you run several pd instances simultaneously.
[1] Radium runs a new wish process for every pd object.