Well, what that really means is that it doesn't understand the code; it thinks it ought to shut off somewhere. In your case, after a -> unit1 = a; if (...etc). The code doesn't make a lot of sense anyway (unless it's test code, and you're just making unit1 == a right from the start). Even so, though, you're not using it right.
unit1 = a;
if (unit1 == a) then {unit1 moveincargo b};
Would move a, or unit1, into the cargo hold of b. I suggest you avoid using names like 'a' and 'b' though, and instead use things like the aforemention unit1/ab whatever - single-letter names easily get confusing.
Wolfrug out.