In the example snippet for this contraption, it's placed on a card with the following script:
on view do prev.locked:!chat1.hasprev next.locked:!chat1.hasnext end
The "prev" button has the script:
on click do chat1.prev[] view[] end
And the "next" button has the script:
on click do chat1.next[] view[] end
Together, these scripts automatically lock/unlock the buttons based on whether or not the contraption has a previous or next chat message available to display, and updates that status every time the user pages through messages. None of this is strictly necessary; it's just there to make the UI more legible. You can customize these buttons as you please or get rid of them entirely and advance the chat log via some other means if you prefer.
Does that help clarify the behavior you're seeing?