Using the Clamp() expression would work well in this situation.
Clamp takes 3 parameters like this: Clamp(value, min, max).
With a window size of 640x480 and no scrolling you can restrict the player to the bottom half of the screen with this:
Every Tick:
--player| set X to Clamp(player.X, 0, 640)
--player| set Y to Clamp(player.Y, 240, 480)
With scrolling change it to this:
Every Tick:
--player| set X to clamp(Mouse.X-ScrollX, -320,320)+ScrollX
--player| set Y to clamp(Mouse.Y-ScrollY, 0,240)+ScrollY
ex:
http://dl.dropbox.com/u/5426011/examples%209/vertical_scroller.capx