Welcome! This forum was set up a number of years ago so that customers could help other customers with the Samsung SmartThings ™ Home Automation platform, so all of the questions and answers are assumed to be in that context.
Edge Drivers like the one that Mariano wrote are part of that architecture, and will only run on a SmartThings hub, as they are part of the embedded firmware.
There are some community members who use both SmartThings and home assistant, but it would require that you have a SmartThings/aeotec hub. The edge drivers themselves are not portable.
Maybe some user who uses the @TAustin MQTT driver can tell you how to implement the solution of changing the sensitivity of the device in the code of your ZigBee2Mqtt driver.
I translated your .lua to .js and included it as an external converter to Zigbee2mqtt.
This did half of the trick.
I could at least select the parameters for threshold and theshold multiplier, but could not access them.
Zigbee2mqtt reported an unsupported attribute.
Knowing from your work that the parameters are there and could be available, it seems there is something missing, to publish the parameters in the device.