It's hard to know exactly what your friend was describing. If you can provide some more detail about what your friend's insurance company sent her, you can probably get a clearer answer about this.
It's very common to send someone an email with a link that goes to an online service (branded or unbranded) that then allows the user to digitally sign the document. Those are services like docusign, etc. There are also a bunch of mobile apps that are doing digital signatures, and I've seen some plug ins for Outlook, etc. that can do it.
But I'm not sure about a 'script' that would facilitate this in an easy way. The easiest one I've seen is docusign, by far. To create something like that from scratch would almost certainly cost more than the 3rd party services.
The fewer our wants, the nearer we resemble the gods. — Socrates