I havent looked at your capx but Im just thinkin of how Id do it:
Say 100 is the max distance from the edge you want to start scrolling. 100 - the current distance from the edge clamped between 0 and your max speed then scroll by that amount.
As you get closer to the edge the distance will decrease and less value will be subtracted from 100. Using that value will make it scroll faster. Pretty simple