The usage of makevar for such stuff is not recommended since it makes things looks more complicated than needed and is slower than directly making up a correct variable name.
NPC Code:
setstring this.msg#v(msgcount),#v(this.r),"#I(client.addmess age,i)";
->
this.("msg" @ msgcount) = {this.r, client.addmessage[i]};
setstring this.msg#v(j),#s(this.msg#v(j+1));
->
this.("msg" @ j) = this.("msg" @ (j+1));