The mysterious "T" is CPU clock tick, as mentioned above, and it figures as a "non-dividable time quantum" on this computer. When you need to do something with perfect timing (e.g. audio generation), you had to compute how much ticks your routine takes (each instruction takes a known amount of T). It is very painful, but because ZX Spectrum has no HW timers, there was no other way.
ZX Spectrum's BEEP is a quite simple "square wave generator". At first, it computes how much Ts (= CPU clock ticks) it will need per one wave cycle, then repeat: toggle EAR output between 0 and 1 and wait for a given number of Ts.