Since I use 6.21 (but it may be not related since I work further on this script from time to time), mIRC sometimes suddenly hangs without apparent reason. It takes all CPU it can get, doesnt update its windows anymore, and pingouts on all connections.
Two days ago I used a tool (TCPview from SysInternals) to kill all the connections mIRC had to IRC servers, and mIRC started to respond, but only for a dozen seconds and not swift, and I was again forced to kill the process.

This morning it happened again and I used Process Explorer to save the process information.
The mIRC process had 902 threads. The situation was 11 irc server connections and low script load (due to not much IRC activity).

I assume this isn't a bug in mIRC but something in my script. It's a rather big one so I'm not sure how to track this down.
It's probably caused by an execution path that gets stuck in a loop.
The problem is, I have no idea where to start. Adding filelog writes to every alias and digging through the logs (of ex like 2 days between two 'hangs') would be a giant job.
Maybe someone has an idea on how to cope with this?

This is the log Process Explorer wrote:
Process PID CPU Description Company Name
Idle 0x0 System Idle Process
SNDVOL32.EXE 0xFFFA7BB7
DDHELP.EXE 0xFFFA22FF Microsoft DirectX Helper Microsoft Corporation
KERNEL32.DLL 0xFFCF36C7
MSGSRV32.EXE 0xFFFF60DB
SPOOL32.EXE 0xFFFF68C3 Spooler Sub System Process Microsoft Corporation
MPREXE.EXE 0xFFFF48F7 WIN32 Network Interface Service Process Microsoft Corporation
TABLET.EXE 0xFFFFF8A3 WacomService Wacom Technology, Corp.
PERSFW.EXE 0xFFFFB157 Tiny Personal Firewall Engine Tiny Software
mmtask.tsk 0xFFFF4177 Multimedia background task support module Microsoft Corporation
EXPLORER.EXE 0xFFFE36B3
TASKMON.EXE 0xFFFEF453 Task Monitor Microsoft Corporation
SYSTRAY.EXE 0xFFFEECEB
PDESK.EXE 0xFFFEDDF7 PDesk Matrox Graphics Inc.
MIRC621.EXE 0xFFFE9A5B 54 mIRC mIRC Co. Ltd.
DSCLOCK.EXE 0xFFFE41AF DS Clock Duality Software
TABUSERW.EXE 0xFFFD45AB TABUSERW Wacom Technology, Corp.
MISITRAY.EXE 0xFFFD32FB miroVIDEO Tray Application Pinnacle Systems
misiCTRL.EXE 0xFFFD0123 miroVIDEO DCxx Playback Control Utility Pinnacle Systems GmbH
INCD.EXE 0xFFFD050F InCD Nero AG
VIRTUALDUB.EXE 0xFFFBC16F VirtualDub
PROCEXP.EXE 0xFFF8EF57 46 Sysinternals Process Explorer Sysinternals
VIRTUALDUB.EXE 0xF640C763 VirtualDub

Process: MIRC621.EXE Pid: FFFE9A5B

Type Name
Device VNETBIO
Device WSOCK2
Event WacomNewFrontAppEventName
File C:\WIN98\SYSTEM\SHDOCVW.DLL
File D:\TEMP\IEXPLO~1\INDEX.DAT
File C:\WIN98\COOKIES\INDEX.DAT
File C:\WIN98\GESCHI~1\INDEX.DAT
File C:\WIN98\SYSTEM\STDOLE2.TLB
MappedFile D:_TEMP_IExplorer_index.dat_65536
MappedFile C:_WIN98_Cookies_index.dat_16384
MappedFile C:_WIN98_Geschiedenis_index.dat_81920
MappedFile fileAllocatorMutex
MappedFile DCOMSharedGlobals12321
MappedFile fileAllocatorMutex
MappedFile rpcrt4sharedmem
MappedFile mIRC
MappedFile mIRC
Mutex WininetStartupMutex
Mutex MPRMutex
Mutex OLESCMLOCKMUTEX
Mutex _!MSFTHISTORY!_
Mutex d:!temp!iexplorer!
Mutex c:!win98!cookies!
Mutex c:!win98!geschiedenis!
Mutex OleCoSharedStateMtx
Mutex OLESCMSRVREGLISTMUTEX
Mutex OLESCMGETHANDLEMUTEX
Mutex OLESCMROTMUTEX
Mutex OleDfSharedMemoryMutex
Mutex ScmWIPMutex
Mutex WacomTouchingAppNameMutexName
Mutex Winsock2ProtocolCatalogMutex
Mutex Winsock2ProtocolCatalogMutex
Mutex ObjectResolverGlobalMutex
Mutex Microsoft RPC UUID Mutex
Mutex Autodial
Process MIRC621.EXE(FFFE9A5B)
Semaphore DocfileAllocatorMutex
Semaphore DocfileAllocatorMutex
Thread MIRC621.EXE(FFFE9A5B): FFFCEA97
Thread MIRC621.EXE(FFFE9A5B): FFF0CE23
Thread MIRC621.EXE(FFFE9A5B): FFFEE717
Thread MIRC621.EXE(FFFE9A5B): FFFCFA5B
Thread MIRC621.EXE(FFFE9A5B): FFFEE467
Thread MIRC621.EXE(FFFE9A5B): FFFCF53F
Thread MIRC621.EXE(FFFE9A5B): FFFCFFB3
Thread MIRC621.EXE(FFFE9A5B): FFFAFF97
Thread MIRC621.EXE(FFFE9A5B): FFFCFD8F
Thread MIRC621.EXE(FFFE9A5B): FFFCF837
Thread MIRC621.EXE(FFFE9A5B): FFFCC2AB
Thread MIRC621.EXE(FFFE9A5B): FFFCC603
Thread MIRC621.EXE(FFFE9A5B): FFFCC4DF
Thread MIRC621.EXE(FFFE9A5B): FFFCC087

[snipped]