Btw though,
function teststuff(mWnd: hWnd; aWnd: hWnd; Data: PChar; Parms: PChar; Show: Boolean; NoPause: Boolean): integer; export; stdcall;
begin
delay(2000);
result:=1;
end;

That's wrong, (forgive me if my correction isn't right, it's been a while since I touched Pascal/Delphi):

function teststuff(mWnd: hWnd; aWnd: hWnd; Data: PChar; Parms: PChar; Show: Boolean; NoPause: Boolean): integer; export; stdcall;
begin
if (not (NoPause = 1)) then
delay(2000);
result:=1;
end;

In case that's not right, let me explain what it does. If NoPause is true, then mIRC is saying "I'm busy, don't do anything that will take a lot of time" to a computer, 2 seconds is a lot of time. So if NoPause = 1, then you can't call delay.