I thought it was when close quarters, retreat (if possible) first with warnings and if still keep coming, then lethal force. Computer nerd too.
If you are in your house where are you going to retreat to?
If you are outside and you retreat are you turning your back on the assailant?
Obviously if the assailant runs don't fucking shoot him in the back.
As @Itaro pointed out I would stay away from trigger modifications so get something that you can shoot well with stock trigger.
Glock factory sights suck and getting better sights or an RMR optic installed I would have my lawyer argue increases safety by allowing more accurate shot placement making it safer for property/people that are not the assailant.
Stippling the frame shouldn't make it inherently unsafe.
Basically I wouldn't touch the trigger or barrel.
This is my opinion and I am not a lawyer.
And a prosecutor is going to nit pick anything not factory and he probably knows less about how guns work then the person he is prosecuting for self-defense.
Same goes for opposing counsel in then inevitable civil case.