1. Agents run in the program slots on your deck. You can run multiple agents, one in each program slot (p.246). Agents are a kind of program, and you can't run multiple copies of the same program (p.243), so if you want to run multiple agents, I'd say you'd have to buy them separately. You could run two agents with the same rating, just not two copies of the same agent.
2. There are no official rules for writing your own programs. Talk to your GM. I'd suggest maybe a Software + Logic (18, 1 week) Extended Test? See the test threshold and interval tables on p.48.
3. Not clear. Because agents run in the program slots on your cyberdeck and share your Matrix Condition Monitor, I would rule that they share whatever marks you have.
4. Agents have their own persona, use their own skills (Computer, Cybercombat, and Hacking equal to their rating), and roll their own Initiative. They can attack IC and personas on their own, or they could help you with a teamwork test if the GM allows. There are rules for Teamwork Tests in melee combat (p.188); so Teamwork Tests in Matrix combat seem reasonable enough.
5. Yes, an agent can take any actions using the Computer, Cybercombat, or Hacking skills. If your commands are complicated, the agent might need to make a test to understand. The Agent description (p.246) specifically refers to the rules for Pilot programs (p.269): roll its rating x2 against a threshold set by the GM to see if it can sort out the situation on its own.
6. I think because you share a condition monitor with the agent -- and especially if the GM allows you to share marks with the agent (see #3 above) -- then it also shares your Overwatch Score and its actions add to it.
7. Rating + Data Processing + 4D6.
8. The agent runs in a program slot on your cyberdeck, so if your cyberdeck is running silent (p.235), then so is the agent, and its Matrix actions have the same -2 penalty.
9. Agents take the Matrix damage from the attack and ignore biofeedback.