It depends on what the IDS is designed to look for and what the exploit is. Is it looking for the script code? Or is it looking for the effects in the traffic?
If it is looking for the effects on the wire, then there will be little one can do to hide that from the IDS, no matter if it is a script or a compiled binary.
If the target needs to experience the traffic in a particular way in order for the exploit to work, then that particular way will be detectable on the wire.