$window(windowname).dw (width in pixels of the text area)

then use $wrap

heres a starter to get ya off the ground
Code:
; $1  = windowname
; $2- = text
/dw {
  if ($window($1) == $1) {
    var %i = 1
    while ($wrap($2-,$window($1).font,$window($1).fontsize,$window($1).dw, 0, %i)) {
       echo $iif($1 == Status Window,-s,$iif($1 == Message Window,-d,$1)) [ $ifmatch ]
       inc %i
    }
  }
}