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;
on *:JOIN:#mychannel:{
if ($me isop #mychannel) whois $nick
}
raw 319:*:{
if ($2 ison #mychannel) goto kick
else goto end
:kick
if (#forbiddenchannel isin $3-) kick #mychannel $2
:end
}