Who should handle an emergency when there's both a certificated pilot and a CFI on board? While practicing for my commercial certificate in a T-tail Piper Arrow IV, I put the gear down on downwind, and one green light didn't come on.

In the right seat was a CFII/Multi, who had over 1,000 hours but less than 10 hours in Pipers, whereas I had about 300 hours, and over 200 in Pipers, having done my PPL in stiff-legged Cherokees. 

As a certificated pilot, I was PIC, but we talked about how to handle the emergency, and the CFI and I decided that since I had so much more experience in Pipers, I would handle the emergency tasks, while he handled the radios and looked for traffic. 

We did the proverbial tower fly by (although they wouldn't say anything except the gear "appeared to be down"), and they cleared me to land on any runway. Our landing was uneventful, and it turned out to be an electrical MX issue.

When we landed, however, the flight school nearly fired the CFI for not having taken control of the aircraft during the emergency. 

Did we make the right decision for me to handle the emergency? Or should I have let the CFI/CFII/MEI with over 1,000 take over as PIC and handle the airplane?
From a safety perspective both pilots should be handling any emergency that arises, each working to their individual strengths and expertise to ensure a safe outcome.
This is exactly what you did in the scenario you describe.

In terms of who calls the shots (acts as PIC for the emergency), generally the most qualified pilot onboard should be the one giving the orders. Deciding who that is falls to the pilots onboard (because they're the ones who will arrive at the scene of any resulting accident first).



So in my mind the question really is "How do I determine who is most qualified?" -- Any opinion we can give here comes dangerously close to second-guessing your emergency actions which is something I personally try to avoid, but I'm going to embellish your scenario above for illustrative purposes:


The Instructor
Former air force pilot ATP, CFI/CFII, MEI.
10,000 hours in various jets, 10 hours in an Arrow (doing this instructing gig.) and for the sake of argument no other time in PA-28s.  
You
PPL + Instrument Rating, working on your Commercial.
300 hours, 200 in fixed-gear PA-28s and let's say 20 in Arrows.


I'll further assume you both kept your cool and didn't panic (because if either of you turned into a quivering blob that would automatically disqualify them from taking control of the aircraft).

If we go by the certificates, your instructor is certainly "more qualified" - and in 10,000 hours they've probably dealt with more real-world emergencies than you have.  

If we go by "time in type" and experience flying PA-28 variants you're clearly more familiar with the general type, and possibly this specific aircraft &amp; systems (like the emergency gear extension system).

Given the above, having you handle the controls seems to be the most logical course of action. The CFI can do "everything else" - communication, traffic scan, calling out checklists &amp; altitudes, etc. - to ensure that you can concentrate on flying the plane and landing as safely as possible.