I think it is an interesting idea. In Skyfall, James Bond gets a gun coded to his palm-print so that only he can fire it. It's not a bad idea to prevent gun accidents.
That being said, I think more focus should be placed on gun education (it's less expensive for one and already proven to be effective). I agree that this technology could actually be a problem in the military.
Additionally, the statistics of gun accidents are rather low. In 2005, the percent chance of having a fatal gun accident was about the same as the percent chance of dying in a plane crash or from bronchitis. In 2003, children 14 and under suffered 56 fatal gun accidents compared to 86 children drowning in bathtubs and 285 drowning in pools. For children 10 and under, the chance of death by drowning in a pool is 1 in 11,000 while death by gun is 1 in over 1,000,000.
Over the past 10 years, people haven't really pushed to implement "safety features" into pools or bathtubs. Really, people focus on having common sense and swimming education.
So, my stance on guns is that the focus needs to be on gun safety education.