It wasn't undetected by the legion, they just couldnt get to it. You can obviously tell it wasn't undetected as Rakeesh immediately attacked the Exodar so we couldnt activate it.
We didn't do more good than bad by killing illidan. He was going to launch an attack on Argus, where the army of light is currently losing a battle with the legion. Had him and his demon hunters showed up 10 years ago, this invasion probably wouldn't be happening.