Auto ScrollTo() issues

I’m trying to implement an autoscroll in the velo code, but can’t seem to get anything to work. I’ve gotten as far as listening for the scroll up or down, but I need to have the code run once when the user scrolls, stop allowing scroll input, scroll to the next anchor automatically, and then resume allowing scroll input. I’ve got some code, but I’m really stuck past noticing if the user scrolls up or down.

import wixWindow from 'wix-window';

let ScrollPosition = 0
let ScrollDirection = ""

$w.onReady(function () {	
	setInterval(responsifyScroll, 100);
});

function responsifyScroll() {
	const anchors = ['#anchor1','#anchor2','#anchor3'];
wixWindow.getBoundingRect()
        .then((windowSizeInfo) => {

            //check for scrollY

            if (ScrollPosition !== windowSizeInfo.scroll.y) {
                //                console.log(ScrollPosition)
                //check if scrolling down
                if (ScrollPosition < windowSizeInfo.scroll.y) {
                    ScrollDirection = "DOWN"
                    console.log("DOWN")
                }
                //check if scrolling up
                else if (ScrollPosition > windowSizeInfo.scroll.y) {
                    ScrollDirection = "UP"
                    console.log("UP")
                }
                //set new scrollY
                ScrollPosition = windowSizeInfo.scroll.y;
                        console.log(ScrollPosition)
            }
        });
    if (ScrollDirection === "DOWN") {
        // code to Scroll to next anchor

    } else if (ScrollDirection === "UP") {
        //code to scroll to previous anchor
    }
}