The problems with only one line being sent to the server is a feature of eggdrop. It is designed, so that the same message doesn't need to be sent twice.
You can disable this, by correctly reading your config files.
As for the conversion script.
This is an example. Send it a intiger, and it will spit out a string.
proc getbytes {int} {
set bit [list "bytes" "KB" "MB" "GB"]
set i 0
set int [expr $int + 0.0]
while {$int >= 1024} {
incr i
set int [expr $int / 1024]
}
set ret "${int} [lindex $bit $i][expr ${int}>1?"'s":""]"
}