there might be too many questions in one post, which makes answering difficult. Next time try to raise separate questions please.
1.) yes, bitcoin is working on an extremly well tested code. And yes, there is a p2p network to excahneg information about valid transactions and valid blocks.
2.) hmmm, yes. Full nodes load the whole history ("the Blockchain") with all transactions since inception. There are however nodes, that can use pruning. Then you only keep a set of last transactions in your node.
3.) Which code? Bitcoin exists of several 1000 lines of code.
4.) The bitcoin core wallet can be downloaded as source code, then you need to compile it, to get it running. Or you download the binary, which is directly executable. The software includes a wallet. And a fresh start will download the "ledger" ( we call it the blockchain).
5.) yes, since there is no centralized server, this code is working on all nodes.
6.) Yes, you can access the network after code changes. And yes, you can change block reward. It is just, that your local node might think, you have had a higher reward, but when you try to spend this at any point in time, it will be recognized as an invalid transaction by the other nodes.
I consider reading the book from A. Antonopoulus "Mastering Bitcoin". A lot of stuff get's much clearer, than just a few words here. It is available in many languages. The online link is here: http://chimera.labs.oreilly.com/books/1234000001802/