Applescript to highlight text in Chrome using Javascript
Make sure you've enabled JavaScript from AppleScript in Google Chrome


  Executing JavaScript through AppleScript is turned off. To turn it on, from the menu bar, go to View > Developer > Allow JavaScript from Apple Events.


I've made a few changes to your script for it to work, with the changes highlighted in bold.


The scrollPos variable and its associated handling of scrolling by getting and setting window position was superfluous, so all references to it have been removed.
All execute verbs need to tell window 1, not just one verb. I've added to tell window 1 to the enclosing tell of the application.
The execute verb takes a reference and a JavaScript string, not just JavaScript. You are missing the reference on all your execute verbs.



set myList to {"AppleScript", "2018", "CLOSED"}

tell application "Google Chrome" to tell window 1
    execute active tab javascript "document.designMode = 'on';" -- scrollPos and page offset removed

    repeat with thisText in myList
        execute active tab javascript "var sel = window.getSelection();
                    sel.collapse(document.body, 0);
                    while (window.find('" & thisText & "', true)) {document.execCommand('HiliteColor', false, '#5cdf64');}
                    sel.collapseToEnd()"
    end repeat
    execute active tab javascript "document.designMode = 'off';" -- scrollPos and page offset removed
end tell

To run it on all tabs, wrap it with repeat with atab in tabs:


tell application "Google Chrome" to tell window 1
    repeat with atab in tabs
        execute atab javascript "document.designMode = 'on';" -- scrollPos and page offset removed

        repeat with thisText in myList
            execute atab javascript "var sel = window.getSelection();
                    sel.collapse(document.body, 0);
                    while (window.find('" & thisText & "', true)) {document.execCommand('HiliteColor', false, '#5cdf64');}
                    sel.collapseToEnd()"
        end repeat
        execute atab javascript "document.designMode = 'off';" -- scrollPos and page offset removed
    end repeat
end tell