Hi. Not my script, but here's how I read it. The F8 message is the Time Clock message, sent 24 times per quarter note. The script counts these messages in G0, so it adds 1 for every message. The modulus operator, G0 % 60, gives the remainder after dividing by 60 ($96), so it's the position in the bar, range 0..$95.
Most of the script is inside the IF M0 == F8 ... END, so it runs every time it receives a MIDI clock message. The last step in that block is the MAT G0 = G0 + 1. So it adds 1 to G0 for every MIDI clock message.
Since this will count 96 for every bar, the value in G0 will get quite large. Now, it is reset to zero for start, continue, and stop from the host. But I'm not sure why you wouldn't reset it every time it reaches 96. However, G0 is a global variable in StreamByter, so another script may be relying on this value. Depends on what you're doing, obviously.