It actually looks like you did everything right. The issue you have with the score is due to Storyline not allowing JavaScript to access system variables
https://access.articulate.com/support/article/accessing-system-variables-in-articulate-storyline-javascript-triggers so it's not you.
You would need to have your own variable that tallies up the scores. For example, create one variable per question (q1score, q2score,...) Set q1score to 10 when the correct layer is shown and to 0 when the incorrect layer is shown, etc.
On the result slide, before all the JavaScript, add up your variables q1score, q2score,... into quizpoints and then write the quiz points to your Google Sheets.
You're definitely on the right track.