Posting here in case it's useful to anyone..
I ended up finding a workaround in BTT settings rather than fixing the script.
Microsoft Surface Dial.bttpreset (35.0 KB)
The script under Generic Devices > Surface Dial provides for double press, single press, right jog, left jog, hold press and jog right (nextTrack trigger), and hold press and jog left (previousTrack trigger).
Double press is also a top level trigger. By default it async delays next action by 0.3 seconds. This is as the script is flawed and recognises a double press followed by a single press whenever there is a double press.. so the delay allows the single press to be registered before opening Roon where it would pause/play (can configure whatever app you want to open).
I then have Roon specific triggers. When Roon is open, these map Roon keyboard to the triggers:
single press = play/pause
right = volume up keyboard shortcut - rotation linked to volume, left = volume down, press and hold whilst turning right = next track, press and hold whilst turning left = previous track.
The press and hold actions have a delay next action by 1.5 seconds.. again this is a work around for the broken script, as otherwise pressing is recognised as multiple button presses, and triggers unwanted actions. so you have 1.5 seconds to release the button when changing track, during which other actions won't be recognised. seems to work ok though.
A Double Press when Roon is opens the Menu Bar Controller for Sonos app. Here double pressing returns to Roon.
So basically the Double Press rotates between applications, starting with Roon.
This works well for my old Mac that is used specifically for Roon server, but may be problematic for your use case due to the script limitations.
Hope it's beneficial to someone, and please post any improvements you may make