Insert as smart object and wait for "done", then send a script

This is demo 3 for Photopea Live Messaging API
To detect, if a smart object was loaded we check the number of layers with a script ever 50ms.