Nice example.
For the world size just keep in mind that the perlin's size is independent from any other sizes. You can create a virtual huge world (by setting the width and height of the perlin noise) and then use certain methods to draw the world's current section, like the one newt explained. But there is no limitation (You already experienced this, because in your example you lookup the perlin table at positions outside the perlin's size. It is set to 30x30, but you look up to 50). Just set a "sight-range" half the units of one screen. Then when moving lookup the perlin at sight-range and draw the appropiate sprites (or delete them if they are out of sight). In your example one perlin unit equals one sprite, and one sprite is 32x32 pixel. For one screen (your window is 640x480) that means 20x15 perlin units, and so you would look at your player's unit +/- 10 horizontal and +/- 8 vertical.
perlin noise is generated around zero on both sides, negative and positive. If you set 4 you will get a value between -4 and +4
For the trees: Why not make multiple use of values? For example, if you would use integers from 0 to 100, you could define that 50 represents grass, while 51 represents grass with a tree on top, and so on.