The issue here is that currently, mIRC can only detect keypresses within custom windows.
In order for your idea to work, you need to be able to detect when the TAB key is pressed in an editbox to complete a nickname. As far as I know, mIRC itself can't do it. I'm quite sure a DLL exists that allows you to detect this.