OK - lets inspect the 2 lines of code in use.
The first, looks to see what the first character in the $min variable is. If it's a 0 (In most languages, 0 is seen as false), it will set the value of $min, to the second digit in the variable, leaving it only 1 character in length.
This means, that $min will no longer have it's 2 digit length, that has me so hot an bothered, and causing all these issues with errors.
The second line, does some simple math, to figure out what time throughout the hour it is.
If the time is 30 mins past the hour, the following happens.
Devide 20 by 15, and you get 1, with 5 remaining (remember, we are working with decimal whole numbers, and not floating points, so we don't get the 1.33333 crap).
If it is 30 min past, we get 2 and 0 remaining.
As you should see, the possible values that can be used as a remainder are
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
So when there is 0 remaining, it must either be 0, 15, 30 or 45 mins past the hour.
Again, remember that the if command works by true and false values, with 0 being flase, and any other being true.
As such, if the remainder is 1 or upwards, that the code "return" is run, thus stopping the script, if it is 0, then it is skipped, causing the script to complete it's journey.