You can get a computer to build the buildings with an AI script, and use the method above to detect when it has started to build. You could get an unfinished zerg building by setting the build time of an extractor to 1, and getting a computer AI to morph into one. The building will never finish. I don't know about Protoss, but if it's only for a few minutes or so in the beginning, you could set the build time of their buildings to a high amount and get an AI to build them, again using the above method for detection.