Sometimes my Logic is not right

I'm not really familiar with the Repeat function. However as written I don't think it will ever stop.

You should also read this post Repeat and End Repeat(?)
.

I would consider using a "private Boolean" with an additional trigger at 10PM.

If time = 4:00 THEN set private Boolean to true.
end-if

If Boolean = true THEN
blinking code Repeat
end if

If time = 10:00 THE set private Boolean = false
end if