To expand what Wolfie said and to add a few things:
For aliases that are treated as identifiers very often, have those near the top of the script.
Do this for all custom aliases that are used often, not just those that are used as identifers. Furthermore, change the script order(alt+r -> "file" -> order) so scripts with said aliases are first.
Limit use to files when possible.
Limit the use of files as DATA STORES (not the number of script files you have). Consider using Hash Tables which are fastest to access or Ini Files which are cached in memory when first accessed. If you must use a text file and are reading it from a loop consider using an alternative such as /filter, /loadBuf, or File Handling related commands & identifers(/fopen, /fclose, $fread, etc)
If it's all in one giant script, see if you can break things down into a few separate scripts.
This can be done by: alt+r -> file -> load.
Re-evaluate the process when the script is activated, such as parsing input from a channel. If there are any requirements that need to be met for the script to kick in, have those requirements checked near the beginning.
In event processing, try to narrow down the trigger as far as possible before getting into the body of the handler
;instead of this
on *:TEXT:*:#: if ($1 == !command) { stuff }
;do this:
on *:TEXT:!command:#:{ stuff }
Furthermore, its better to use multiple events with similar code for different commands than it is to use a single event to handle multiple things
;instead of this
on *:TEXT:*:#:{
if ($nick isop #) {
if ($1 == !command1) { stuff }
elseif ($1 == !command2) { stuff2 }
}
}
; use this:
on *:TEXT:!command1:#:{
if ($nick isop #) { stuff }
}
on *:TEXT:!command2:#:{
if ($nick isop #) { stuff }
}
If all else fails, you can use specific prefixes to bypass mIRC's lookup of custom aliases when using a native command or identifer is desired.
;Bypasses lookup for custom commands by using the ! prefix
!msg # message
.!msg # message
;Bypass lookup for custom identifiers by using the ~ prefix
echo -a $~me
-------------------------------------------
With all of that said, to really help you narrow down your problem areas, we'd need to have far more context such as the script(s) your are using, networks you are connected to, and the channels you are on pertaining to said networks