Someone, I think maybe Jason Snell, commented that almost no one writes AppleScript. We just copy/paste things together until it works.
You should not need to add anything to the AppleScript that I sent.
When I tested it, it was successfully clicking the "Panel Editor…" button. If that is not working for you, it might be because I wrote it on Mojave if you using Catalina, or it might be that you need to increase the delays, especially the '0.1' delays. Change them to '1' and see if it works, then try reducing them to see how low you can go and still have it work reliably.
I'll decipher the AppleScript as best as I understand it:
tell application "System Preferences"
reveal pane id "com.apple.preference.universalaccess"
This will launch System Preferences and open the 'Accessibility' pane.
delay 1
tell application "System Events"
tell window 1 of application process "System Preferences"
select table 1 of scroll area 1
This says "Wait 1 second, then tell the system to select the left column" (table 1 of scroll area 1).
delay 0.1
select row 17 of table 1 of scroll area 1
row 17
= "Keyboard".
Now, if you select the first item in that left column (General) and then count as you press the "down arrow", you will only get the "12" when you arrive at "Keyboard". So why is it "17" here? Because each of the "headers" (General, Vision, Media, Hearing, Interaction) above "Keyboard" also counts as a row.
How did I figure that out? I put in 12 and it select the wrong thing, so I kept increasing it until I got the right one.
delay 0.1
tell tab group 1 of group 1
click radio button "Accessibility Keyboard"
This clicks the "button" named "Accessibility Keyboard" (#4 in your original image)
delay 0.1
click button "Panel Editor…"
This should click the "Panel Editor…" button. Note that is an actual ellipsis not three periods.
end tell
end tell
end tell
-- quit
end tell
All of those 'end tell' lines just close off their corresponding 'tell' lines above.
The 'quit' line (if it did not have the '--' in front of it) would tell System Preferences.app to quit.
(In the part you added, it appears that you were trying to click a button named "OK" which does not exist.)
However…
Now that I have paid more attention to what is going on, I realize that the "Panel Editor…" button is just launching an app, which means we don't need to do any of this.
You can just do this (in AppleScript):
tell application "Panel Editor" to activate
or this (in a shell script)
open -a 'Panel Editor'
You could also do:
open -b com.apple.AssistiveControl.editor
but now I'm just being fancy