Well I don't quite understand what you mean by pages of code but the question I would ask is why? Can't you just create two functions with slightly different names like MyFunction1 and MyFunction2? If not, then you could always pass a boolean parameter to your function and then have an if statement which decides which action the function should take. This might look like:
MyFunction(1)
MyFunction(0)
function MyFunction(bFlag as boolean)
if bFlag = 1
` Code for first task of function
else
` Code for second task of function
endif
endfunction
Hope this helps.