I've used x-gal to stain live embryos that had lacZ driven by a cut enhancer element specific for the malpighian tubules. I dechorionated and devitellinized them, then developed them for about 15 minutes. They survived for about 2 hours after that but could probably have survived longer if I'd had changed the media or put em on a plate.