"Sleep" function that sleeps until a condition is met.

I bet there'd be many new possibilities if there were a "sleep" function that pauses a thread and only resumes it by using variables.
Ideas using this:
Maybe these ideas are already doable somehow, but I doubt having this function would bring nothing new to the table.
Ideas using this:
- Block-made elevators with multiple stops.
- Collected Tri-coins losing their value under a certain condition, but ONLY when they are collected.
- Earthquakes that are only able to stop under a certain condition, but then resume under the same condition being removed. This might be useful.
- Platforms that only play when standing on them, pausing every time you get off (might require a secondary thread to work with it, since using "sleep until on ground" resumes it anywhere).
- ...And other things I'm too lazy to think up.
Maybe these ideas are already doable somehow, but I doubt having this function would bring nothing new to the table.