Ohhh crikey no. This solution has more holes than a sieve.
If you want a technical solution to this problem, there are specialist man down alarms for this sort of thing.
I would never suggest relying on some scripts on a laptop to ensure someone's safety.