Repeat Actions RM Help

Hi, new to Habitat and I'm trying to create a smart alarm clock using the withings sleep pad and Echo Dot for the 'sound' portion of the alarm.

Essentially if it is now Day mode and I'm still in bed I want alarm to play through echo. Once I get up the alarm sound will turn off. However, I'm working/figuring out how to handle if I 'snooze' the alarm by changing the status to stopped or paused.

So I'm trying to incorporate a while loop to check after 10 seconds if I'm still in bed and the echo was paused it will start playing again.

The conditional variables I'm using:
In Bed Switch = still in bed -> ON, out of bed -> Off (Using IFTTT)
Mode = day mode
Alexa Stopped Switch = Alexa stopped or paused -> On, Alexa playing -> Off

Here is what I currently have (Can't post screenshots):

Trigger is if Bed Switch changed

IF (In Bed Switch(off) is on(F) AND
Mode is Day(T) [FALSE]) THEN
setVolume(50) on Echo - Cole' Echo Dot
searchAmazonMusic('Shuffle Playlist, Wake Up: Dance') on Echo - Cole' Echo Dot
** While Loop to be inserted ***
Delay 0:00:15
IF (In Bed Switch(off) is on(F) AND
Alexa Stopped Switch(on) is on(T) [FALSE]) THEN
play() on Echo - Cole' Echo Dot
ELSE-IF (Mode is Day(T) AND
In Bed Switch(off) is off(T) [TRUE]) THEN
pause() on Echo - Cole' Echo Dot

Thanks in advance

I’m sitting at a work site in the parking lot on my phone, so I can’t get to detailed but look at maybe using a wait for condition or event. That is basically what your repeat loop is doing.

So in the context of this example if I have a wait condition of (Bed Switch -> ON AND Alexa Stopped Switch -> ON) THEN Play sound. So now once the play sound is activated the Alexa Stopped Switch -> OFF, would this not exit the loop and if I stopped Alexa again it wouldn't trigger?

Download the Hubitat app