I downloaded your cap, but there's too much going on. Noone but you knows the concept, so I can't say what exactly you are trying to achieve. Could you please do a simple example cap with an explanation where exactly it does not work as intended?
About ScrollX and ScrollY: They return the center point of the current view. If you don't scroll your layout, then those values never change.
Example1:
Window size 640x480, layout size 640x480
ScrollX, ScrollY will always return 320, 240
Example2:
Window size 640x480, layout size 800x600
ScrollX, ScrollY will return 320, 240
If you now scroll your layout, using System: Scroll to X 420 then
ScrollX, ScrollY will return 420, 240