what are you asking? if you're asking 'can you make marines invincible for 5 seconds, and during that time have the comp attack them', the answer is no, invincible's called invincible for a reason

.
however, to make marines invinc for 5 seconds, do this: 'if (whatever); then enable invinciblity for marines owned by current player at location (whatever), wait for 5000 milliseconds, disable invincibility for marines owned by current player at location (whatever), preserve trigger (if you want).