Here it is. The code is not very elegant, but does the work. I didn't change it recently. Names and variables in Polish
Profile: Auto Budzik (71)
Time: 21:00
Enter: Auto Budzik (2)
Stay Awake
A1: Variable Set [ Name:%Test To:0 Do Maths:On Append:Off ]
A2: Variable Set [ Name:%jutro To:%TIMES + (24*3600) Do Maths:On Append:Off ]
A3: Test App [ Type:Calendar Title Data:%jutro Store Result In:%Jutrodyz ]
A4: Test App [ Type:Calendar Title Data:%TIMES Store Result In:%Dzisdyz ]
A5: Test App [ Type:Calendar Calendar Data:%jutro Store Result In:%Jutrosw ]
A6: Test App [ Type:Calendar Calendar Data:%TIMES Store Result In:%Dzissw ]
A7: Variable Add [ Name:%Test Value:1 Wrap Around:0 ] If [ %Dzisdyz() ~R Dyżur ]
A8: Variable Add [ Name:%Test Value:4 Wrap Around:0 ] If [ %Jutrodyz() ~R Dyżur ]
A9: Variable Add [ Name:%Test Value:16 Wrap Around:0 ] If [ %Dzissw() ~R Święta | %DAYW ~ sobota/piątek ]
A10: Variable Add [ Name:%Test Value:32 Wrap Around:0 ] If [ %Jutrosw() ~R Święta | %DAYW ~ sobota/piątek ]
A11: If [ %Test ~ 0/4/16/20 ]
A12: Variable Set [ Name:%Godz1 To:6 Do Maths:Off Append:Off ]
A13: Variable Set [ Name:%Godz2 To:45 Do Maths:Off Append:Off ]
A14: Goto [ Type:Action Label Number:1 Label:Set ]
A15: End If
A16: If [ %Test ~ 1/17 ]
A17: Variable Set [ Name:%Godz1 To:7 Do Maths:Off Append:Off ]
A18: Variable Set [ Name:%Godz2 To:0 Do Maths:Off Append:Off ]
A19: Goto [ Type:Action Label Number:1 Label:Set ]
A20: End If
A21: If [ %Test ~ 36/52/53 ]
A22: Variable Set [ Name:%Godz1 To:8 Do Maths:Off Append:Off ]
A23: Variable Set [ Name:%Godz2 To:0 Do Maths:Off Append:Off ]
A24: Goto [ Type:Action Label Number:1 Label:Set ]
A25: End If
A26: If [ %Test ~ 33/49 ]
A27: Variable Set [ Name:%Godz1 To:8 Do Maths:Off Append:Off ]
A28: Variable Set [ Name:%Godz2 To:30 Do Maths:Off Append:Off ]
A29: Goto [ Type:Action Label Number:1 Label:Set ]
A30: End If
A31: Stop [ With Error:Off Task: ]
<Set>
A32: Gentle Alarm [ Name:%Godz1%Godz2 Set:On ]
But again: task works fine if run manually.