Please don't put Twine or Story Format version related information within the Question Title, it unnecessarily pads the title and serves no useful purpose. That information should be specified using the Question Tags, like you done.
WARNING: The example you included (and linked to) was written for the Harlowe story format and makes a number of assumptions:
a. That you want to track the scroll position of ONLY ONE specific Passage within your story, meaning that that code (as is) can not be added to a second Passage.
b. That the permanently tracked position information will effect the specific Passage every time it is viewed, even if that viewing occurs after a "Restart" or after the Reader returns to the Story (assuming that they are using the same web-browser instance and that its Local Storage cache hasn't been flushed.)
The following example should achieve what you want, assuming that your requirements include both of the above. It also assumes that your project contains a passage named Other that links back to the the current passage.
<div style="min-height: 80em;"></div>
Test line.
<div style="min-height: 15em;"></div>
[[Visit the current passage again|passage()]]
[[Go to Other passage|Other]]
<<script>>
/* Only track the current scroll position if LocalStorage is enabled. */
if (window.localStorage) {
/* Execute the following after the current Passage has been displayed. */
$(document).one(':passagedisplay', function () {
var ls = window.localStorage;
var saved = Number(ls['zcwScrollPosition']);
var current = $(document).scrollTop();
/*
Monitor the 'Scroll' event and update the saved value whenever the User
scrolls the current page.
*/
$(document).on('scroll.track-scroll-position', function () {
ls['zcwScrollPosition'] = $(document).scrollTop();
});
/*
Attach handler to remove the 'Scroll' event monitoring whenever the User
does something that causes a Passage Transition to occur.
*/
$(document).one(':passageinit', function () {
$(document).off('scroll.track-scroll-position');
});
/* Scroll page to saved position if required. */
if (saved != current) {
$(document).scrollTop(saved);
}
});
}
<</script>>