why not let alias follow simply do the whois $1 and then set a var like %following to 1. Once you catch the raw command of the whois simply check %following. If it's 1 then run the code which is currently below the whois command and halt the default text of the whois. If it's not 1 then u can just let the whois perform it's normal action by not doing anything at all.

if u don't like that solution u can ofcourse use your own script with another while loop which loops untill the %massjoin string is set. This is risky cause u might get caught in an infinite loop (or however u write infinite :] )

hope this helps, grtz