Technically Bad Dreams is an end of turn effect. You could just make Sleep Clause come into effect before stuff like Leech Seed, Bad Dreams, Sandstorm, etc. The only reason the "end of turn" qualifier is important is in case of something like intentionally putting something with Lum Berry to sleep in order to break the berry.
Also, as I said before, couching it in terms of a mechanic is the wrong way to go about it. It's a rule, and if you break the rule, you are disqualified and have to forfeit. On WiFi, that has to be done voluntarily, but on a simulator, all it does is automate the forfeit that is required by the rules. Calling it an "instant loss" isn't the way to go.