It could be something like this
/join #this
/invite him
/invite her
/join #that
/invite them
/invite those
Just xchat commands, one on each line. You can't use variables, loops, or any sort of control structure here, it's just a list of commands which will be executed in that order.
Put these in a text file and use "load -e c:\Wherever\You Put\The script.txt" as connection command.
if you need a delay after a command it gets tricky with this sort of simple script. suppose you want to wait for 2 seconds after joining a channel before you start inviting others:
/join #channel
/timer -repeat 1 2 invite person1
/invite person2
this contradicts my statement about missing loops and shows how far you have to go to get a simple sleep: This "timer" only runs once (-repeat 1) with a delay of 2 seconds and executes "invite person1" on every loop.
When you need anything more sophisticated than this you will need a proper programming language :)