I'm not entirely sure what this question means, either, but there's something strange about your examples, because you don't have noglob for the "." (dot) command so % . test junk* should be expanding and therefore passing two arguments to the "ls" at the end of the script.
I know, that's just for comparison against the function. That's supposta be globbed. What I'm trying to do is get by without the single quotes in the function call. Hardly a big deal, but it would be cool. Without the quotes it's taken as two arguments because the backslash is stripped after processing -- exactly as one would normally want, but I want zero expansion of the command line. I have reason to preserve a copy of the command exactly as typed. That's why I was thinking that Eric's 'BUFFER' stuff might be the key -- grab the command before any expansion, or at least 'auto quote' it afterward.
I run it over and over again as I play with it. I always run it twice just to be sure.So there's something you're not showing us? Also, in either of your examples but using % . test junk* && test junk* for reference, the "alias test=..." created in the script will NOT be applied to the right-hand-side of the && when this is the first time this script is sourced in any given shell. Aliases have to be in place before the command line is accepted.