I lived in the UK for 5 years, and when I moved out of the country, I left my EEA partner there. In the end, I was never able to visit him because of this stuff. So I know a thing or two about this.
You will be allowed into the country with the visa waiver program for 6 months, as you mentioned.
If you are physically in the UK while you are doing work, it's considered working and would violate the terms of your UK visitor visa. Even if your work is unpaid, it's still classed as 'work' and would be seen as violation as long as you're doing it when you're in the UK. If you told the border agent this, I have serious doubts that they would let you in at all.
Now, would you be detected doing this? I don't know, it's probably quite difficult to catch people in this situation. But it's still a violation of the legal terms of the visitor visa, and if you told a border agent this, you would not be allowed entry. You'd definitely be breaking a few laws to do this.
As far as the 6 month to one year situation:
You can extend your visit to one year if you pay and apply (I'm not sure if 'visiting a girlfriend' counts as valid reason, though), but I doubt that you will be able to just leave in the middle of your 'stay' and try to get in again. The UK border force are cracking down on non-EU migration, and your case has several red flags:
- Visiting a girlfriend (this would indicate to the border agent that you intend to overstay to be with her, even if you aren't).
- Planning to work, against the terms of your visa (this would indicate the same thing; you can sustain yourself inside the UK, and your partner is there, so why would you leave?)
- Several instances of 1x visa waiver entry, which indicates to the border agent that you are attempting to 'live' in the UK. This is one of the first things they look for.
There is no information online concerning how many times / how frequently a US citizen can enter the UK on the visa waiver program. It is up to the discretion of the border agent re: how much of a risk they think you are. Your case, as you've outlined it here, seems quite risky.
For context: I was in the UK on a 5 year student visa. I graduated, and then left the country for a conference. When I returned, I intended to pack up my things and leave two months later. My visa did not expire for 5 more months. I was detained because I was "presenting the risk of overstaying" and "once you graduate, you should have immediately left". I graduated the week before the conference.
I'm a US citizen also, and I was told that admission under the visa waiver does not GUARANTEE entry. I was eventually let in with a 6 month visitor visa, but only barely, and only so I could pack up my things and leave immediately.
Renting: You won't be able to do this legitimately with the terms you have outlined here. Tenant checks are in place and landlords are required to report that their tenants are in the UK legally. If you tried to sign a lease for a flat for a year when you're only there on a six month visitor visa, you will be turned down. You may also need a cosigner since you will have no UK credit information. Your cosigner would need to be a homeowner in the UK. You'd need to pay your deposit and all your rent up front.
If you're surprised, I was too. The UK government really hates non-EU immigration unless you are rich.