$width(t,verdana,20) is 8
drawtext @picture 0 verdana 20 $calc(30 + $width(%currentpictureline,verdana,20)) 30 $1
starts drawing at 30 + 8 = 38 pixels, a letter that is 8 pixels, so that first letter occupies the range 38-(38+8)=38-46 in pixels
$width(th,verdana,20) is 8+13=21
drawtext @picture 0 verdana 20 $calc(30 + $width(%currentpictureline,verdana,20)) 30 $1
draws at 30 + 21 = 51, letter 'h' occupies the range 51-(51+13)=51-64 in pixels
$width(thi,verdana,20) is 8+13+6=27
drawtext @picture 0 verdana 20 $calc(30 + $width(%currentpictureline,verdana,20)) 30 $1
draws at 30 + 27 = 57, letter 'i' occupies the range 57-(57+6)=57-63. previous range was 51-64 so clearly the letter 'i' overlaps the letter 'h'.
The problem is clear here, your starting point for drawing a letter is based on the width of the current letters drawn + 30, where you should be adding 30 for each letter drawn, not just one 30.
Here is a modified example which use 6 pixels between each letter:
alias spell {
window -dpf @picture -1 -1 600 400
;start at 30 pixels (24 + 6)
var %word = 1, %letter,%width = 24
while (%word <= $0) {
%letter = 1
while (%letter <= $len($($+($,%word),2))) {
%width = $sendletter($mid($($+($,%word),2),%letter,1),%width)
inc %letter
}
inc %word
}
}
alias sendletter {
drawtext @picture 0 verdana 20 $calc($2 + 6) 30 $1
return $calc($2 + $width($1,verdana,20) + 6)
}