It doesnt work because, very simply,
bset -t &data 640 $1
The variable DOESNT exist, and you are writing $1 to the
640th Byte, which tells mIRC to zero-fill from 1-639 (with 0's).

And, low and behold, mIRCs $bvar().text reads up to the first
zero character and not beyond, hence why theres no text,
because the first character is a zero.

Eamonn.