The code you found on the web is pretty much a direct representation of the hardware.
The ports on the chip are accessed through registers: SET, CLR, DATA, READ, and HIZ. I do not remember the exact names given.
DATA is merely an output data latch and READ picks up the voltage on the pin so if you SET a pin that is pulled to GND externally the READ returns a ZERO. This is a deviation from most processors in that you can flash your LED with out effecting the rest of the port with out doing a read/modify/write cycle. This can save a lot of time randomly toggling ports, espescially since you can set or reset as many as you want in a single write. The ARM CORTEX goes all the way to direct hardware pin addressing.