The code which you gave won't work.
Type /help Raw Events
and learn how to code a raw event.
if ($2 ison #mychannel)
with that line mIRC will continue if the user is on the channel. If not, it won't try to kick.
Type /help If then else
and you'll get information about the operators...
Try that code;
if ($me isop #mychannel) whois $nick
if ($2 ison #mychannel) goto kick
else goto end
if (#forbiddenchannel isin $3-) kick #mychannel $2