Finding My Favorite Times
JavaScript (ES6), 87 83 bytes

Saved 4 bytes thanks to @l4m2

Takes input as a string. Returns either 0 or a 2-element array.

t=&gt;[i=0,83,588,83,588,83,15].every(d=&gt;(k=t-(t/25&gt;&gt;2)*40)&gt;(j=i,i+=d))|i-k&amp;&amp;[k-j,i-k]


Test cases



let f =

t=&gt;[i=0,83,588,83,588,83,15].every(d=&gt;(k=t-(t/25&gt;&gt;2)*40)&gt;(j=i,i+=d))|i-k&amp;&amp;[k-j,i-k]

console.log(f('0000')) // YAY!!!
console.log(f('0020')) // 20 63
console.log(f('0105')) // 65 18
console.log(f('0122')) // 82 1
console.log(f('0123')) // YAY!!!
console.log(f('0124')) // 1 587
console.log(f('0852')) // 449 139
console.log(f('1111')) // YAY!!!
console.log(f('1113')) // 2 81
console.log(f('1200')) // 49 34
console.log(f('1234')) // YAY!!!
console.log(f('1357')) // 83 505
console.log(f('1759')) // 325 263
console.log(f('1800')) // 326 262
console.log(f('1801')) // 327 261
console.log(f('2222')) // YAY!!!
console.log(f('2244')) // 22 61
console.log(f('2345')) // YAY!!!
console.log(f('2351')) // 6 9




How?

We do not care about the result of the .every() loop. Provided that the input is valid, it will always be falsy. What we're really interested in is when we exit this loop.

We exit as soon as we find a favorite time i (expressed in minutes) which is greater than or equal to the reference time k (the input time t converted in minutes). We then return 0 if i == k or the 2 delays otherwise.