The documentation you’re referring to is the SDK documentation, which is limited to apps (so if you want to use any SDK methods, you need to write a full app).
Homeyscript uses the WebAPI, and specifically, the HomeyAPI (which is available from Homeyscript through the Homey global variable). You can’t write device drivers in Homeyscript.