I got it working (for the most part), without needing to use the dirty variable hack.
ah, quite right, since the first condition implies the second.
It still takes out any extra spaces in the edit box string
yes, that's very unfortunate and entirely unavoidable without a DLL. a while ago i abandoned a sophisticated identifier completion script i was making because of it :( bear in mind you can add a single trailing space to the editbox with /editbox's -p switch.