As you probably know, Variables in NSIS are global no matter where they are declared (top of file, function, or section. See:
http://nsis.sourceforge.net/Docs/Chapter4.html#4.2). If you declare them in a function, you have to place /GLOBAL in front of it to indicate this. When you declare a custom page to use:
page custom MyPage MyPageLeave ;where MyPage is the function to define the page and MyPageLeave is called when the page is left.
Then you would have two fxns somewhere in your nsi file:
Function MyPage
Var /GLOBAL someVar
;some code to define and display your page
FunctionEnd
Function MyPageLeave
;maybe manipulate the user provided integer here.
FunctionEnd
It is possible that if you manipulate the user provided integer right away, you could do so in the MyPageLeave function and only ever need one variable for this integer. However, if you obtain a series of integers before you do anything with them, then you likely need to create separate variables for however many instances you will need. So if you will display the page five times and require five inputs, declare five variables (kind of ugly, I know and someone may have a better suggestion). Also, I suggest you consider using an array for this if it fits what you are trying to do because it could be cleaner. Hope this helps.