As of version 1.12.5 of the Ingress Scanner app, we can answer these three questions as follows:
- There is a limit of 2000 inventory items; this would limit your number of portal keys along with other items.
- When you're at this limit, or if you upgraded while above this limit, your ability to hack is blocked, meaning presumably, that doesn't happen.
- It is very clearly possible to hold duplicates of keys, they are shown in your inventory with the title addendum "(n)" where n is the number of copies you own. When you scroll through the keys to make a link, each copy is it's own item card shown grouped with its like portal keys.
It's further worth pointing out that now when you hack a portal it is no longer necessary to not be holding that portal's key in order to receive a key, or a copy of the key for your inventory. E.G. without managing your inventory in any special way, you should slowly find yourself acquiring 2 or more keys for the same portal.
This version's server side changes have also made it far less likely that you'll get a key at all; I had to hack a portal I live almost on top of 20 times over two days to get a single key for it. I have yet to get the keys for 4 portals around me that were added days ago after I submitted them.
XM charge, portal level and nearby targets will determine whether to try hacking a portal before taking it down. Is it a high level portal that will zap you for lots of XM, and you might run out of XM before destroying it or have other targets to attend to? In this case, don't hack while unfriendly.
Otherwise, esp. for portals that need a lot of repositioning and you will take almost 5 mins to kill them, always hack before attacking. Followed by another hack after all deployments are done. Never hack when its neutral or has just 1 resonator, unless you're fond of L1 items ;)
Why would you claim all portals before hacking one? You get 4 hacks, one every 5 mins. It is better to work on burning out portals you captured earlier while you attack remaining targets, unless you plan to do 20+ mins of hacking at the end.
When initially claiming a portal, are there any strategies to have a
better chance of walking away with keys when you're done?
See Is there a way to increase the odds of getting a portal key?
In the case of acquiring portals, remember that attacking a higher level portal before you capture it might give higher level items, but overall less chance of any items. Thus, I expect that for keys its better to hack after it is captured, if you have to choose between the two.
Best Answer
Glyph hacking is intended to be a bonus to your normal hacking. It rewards your speed and (muscle) memory by giving you drops in addition to what you'd normally get from hacking. So no, there's no other consequence if you fail to reproduce the sequence that's been proposed to you.