Tab completion works of the nicklist/listbox of the window, try it with a @window you can tab complete anything in the listbox.

I would assume its based on this for channels as well.

What woukd be nice is the ability to trap keydown in a channel and cursor position in editbox so your suiggestion could be scripted in.
(not that i dont think your suggestion doesnt have some nice merit to it!)