Yes, you can run scripts in play mode. You should avoid some commands that are obviously not meant to work outside REC mode (involving such things as shooting, zooming, setting focus etc), because some of them might not check that you're not in REC mode and could thus be potentially harmful if the lens is not out.
I've never seen pictbridge in action, but I guess you'll just need to simulate button presses which will work just fine as long as you remember to sleep long enough between each button press to let the camera work its magic in the menus.