I am sorry , but I'd say that the optimizer problems are due to using linebreaks instead of |n ?
Just use |n , it is fine. (Edit: Now that I read darkwulf's PM, I am about sure that it is because of encoding, try encoding the custom wts with UTF8)
Also, the mpq editing part is not necessary at all. You know, have you seen some of my demo maps in which the creeps have their attributes as if they were diablo monsters? It was simple, go to the name field in the object editor, keep shift pressed and double click. Shift works to allow you to insert long stuff with |n and linebreaks just like it allows you to place -1 durations in some places.
Actually, since my method doesn't require touching the wts manually, perhaps it fixes the issues with the optimizer as well.