Primero que nada, ese código es muy sanguangamente inentendible y asquerosamente hecho (valga la redundancia) por el simple hecho que estás revisando cada 100 milisegundos, y en consecuencia te va a terminar laggeando demasiado.
Recomendación:
addEventHandler("onVehicleDamage", getRootElement(),
function()
local DAMAGE_TURN_OFF = 300
if getElementHealth(source) < DAMAGE_TURN_OFF then
setVehicleDamageProof(source, true)
setVehicleEngineState(source, false)
else
if isVehicleDamageProof(source) then
setVehicleDamageProof(source, false)
end
if not getVehicleEngineState(source) then
setVehicleEngineState(source, true)
end
end
end )