"But I get problems once I start adding additional "val" commands."
What kind of problems? You only seem to be reading 1 analog input - did you intend to read 2?
"val" can be 0 to 1023. So once you read, you are not checking anything else for 2 x val, or up to 2 seconds.
Did you want the program to be more responsive? If so, you need to use Blink-without-delay type programming, where you note the time, start the action, and check the time every subsequent pass thru void loop to determine if is time to stop the action.