regarding the spaces issue, there does exist a method to echo the exact line as messaged by the user (with excess spaces intact) by using /loadbuf, an example of which is given here:

the preferred method involves using a DLL such as Saturn's spaces.dll available along with a full double article on the nature of handling spaces in mIRC at:

"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde