If all of the conditions of xDaeMoN's script are matched, then it will work. The conditions, in order of occurance in the script are:
A) the bot or person running the script must be opped
B) the command must be sent in the channel/room
C) the person issuing the command must be opped
C) the person named in the !ban24 command must be in the room.
As to opping someone with a certain IP, if the network has chanserv, review the information about AOP and SOP lists.
/msg chanserv help AOP
/msg chanserv help SOP
If you don't have chanserv, then you can use mIRC's AOP capabilities