incremental dimming [noob to programming]

The compiler has already pointed out to you some scope issues, but even when you've fixed those, you've got the classic noob mistake of testing variables you haven't given a value to (like "up"), and parentheses () when you should have braces {} (assuming that's what you meant).

I'm not sure what you're trying to do with the incrementing and decrementing "val" and then using it in a digitalWrite.

The IDE is packed with worked examples; why not try working through a few?