You could strlwr the message and find the position of the badword, replace the word in the un lowercase by using the position and length of the badword.
%badword = " NOOB ";
%replacement = " im a cigarette! "
%ltext = strlwr(%txt);
while(strstr(%ltext,strlwr(%badword))!= -1){
%ltext = strlwr(%txt);
%pos = %strpos(%ltext,strlwr(%badword));
if(%pos != -1){
%t1=getsubstring(%txt,0,%pos-1);
%t2=getsubstring(%txt,%pos+strlen(ltrim(rtrim(%badword))));
%txt = %t1 @ %replacement @ %t2;
}
}