Yeah, that is not going to work, as the first if statement checks that the player is beyond the bounds, in which case the second if will never be true. And even if it does reach it (on the single frame where the player reaches the bounds) you are adding to zoomfactor and subtracting on the same frame, so nothing will happen. So the if statements should be independent, no nested. You should also set a limit on the zoom, for example, zoomfactor_max.
zoomfactor += 0.01
zoomfactor = min(zoomfactor, zoomfactor_max)
And then on the second if, check if zoomfactor is more than 1.0.