There are certain things that may occur when importing any code into a map... You may already have a function with the same name as one that you're importing, syntax errors, etc.
As for the editor spitting 5,000,000 different errors at you... Let's say for example I botch up a piece of code:
JASS:
if <something> == <something else> then
<insert random code in here>
endiF
Now look at the "endif" the f is a capital letter (capitals count as a different statement EG: "IF" and "if" are 2 totally different things), this will cause the editor to generate an error. But, the error resides in a statement that closes off a section of code... EG: loop/endloop, function/endfunction, if/endif, etc.
Now the function that contained that error, won't close itself correctly either (waiting for a correct "endif") and the next function defined will go "Hey, buddy, you can't define me. You're not finished with the other one yet." creating yet another error. The same thing applies to additional "if" statements after the errored one.
This process chain-reacts through the rest of the script from that point onwards, creating "fake" errors.
If you ever get a massive list of errors, always fix the top one first, then try and save again.