Here is a simple Perl script to change your nickname when going away or back.
create a file named like “myscript.pl” in your ~/.xchat2 folder and paste the code inside
/iway or /iback
#!/usr/bin/perl
### Xchat registers and hooks.
Xchat::register("Ssm's away script", "1.0", "Ssm's away script", "");
Xchat::hook_command("iaway", "setaway");
Xchat::hook_command("iback", "setback");
use warnings;
use strict;
### Main routine.
sub setaway {
Xchat::set_context("#mychannel", "[Banned-URL]");
Xchat::command("NICK ssm2017[Away]");
Xchat::command("AWAY Zzzz...");
}
sub setback {
Xchat::set_context("#mychannel", "[Banned-URL]");
Xchat::command("NICK ssm2017");
Xchat::command("BACK");
}