OP,
I'll go out on a limb, and you may hate me for this - but you have missed the basic language tutorials entirely.
Go back to the Forum Home Page, and study HOW to use the Arduino language (C/C++) - and it's specifics to the Arduino platform.
To read a pin's state - as noted above, you use digitalRead()
To set a pin's state - as noted above, you use digitalWrite()
To loop - ignore the loop() function - that't the main 'container' function of Arduino-land.
It does loop - but outside the scope of anything you are likely to be doing at this stage.
Looping within your functions may achieved be with for(), do-while() or other constructs.
While you're learning, see if you can abandon delay() once you have the basics working.