It is possible to get the thing properties without using the external script to make the API calls. In ECMAScript_2021, using the helper libraries, this is in fact fairly compact.
var ThingRegistry = osgi.getService('org.openhab.core.thing.ThingRegistry');
var ThingUID = Java.type('org.openhab.core.thing.ThingUID');
var myThing = ThingRegistry.get(new ThingUID('DEVICE UID HERE'));
logger.info(myThing.getProperties()['zwave_lastwakeup']);