For invincibility use eventHandlers "hit" and or "killed", depending on exactly how you want to do it, combined with setDammage 0. Again, depending on what you want a small looping script setting damage to 0 may also be appropriate.
For improved skill hunt around the forum and the Editors Depot - there are various enhanced AI scripts and ideas kicking around.