Well, here is a single script... untested, but I am sure it will work...
Create a file called "RespawnLimit.sqs"
Insert this code:
PrivateVariable ["_limit"]
? !(player):exit; Will exit if not a player
_limit=3; Enter your respawn limit here
#WaitForRespawn
@!(alive player); Waits for player to be dead
@(alive player);Waits for them to respawn
_limit=_limit-1; subtracts 1 from _limit
? _limit>0:goto "WaitForRespawn";if player has not reached limit then jump to beginning of loop
#EndScript
;Put whatever action you want here - such as move player to safe zone and go to spectator mode
exit
Then, all you have to do is add the following to the init line of each playable unit
this exec "RespawnLimit.sqs"
This script is designed with the idea that you DO NOT respawn into your group. Also, make sure you place some sort of action to be taken in the #EndScript routine that moves the player out of battle zone, because the player will have respawned and could be killed again - which will completely negate the idea behind this script.
Note: Playable units that have AI will continue to respawn when killed. Take out the "? !(player):exit" if you want playable AI to have limited respawn also.