Hi, had a similar problem whilst doing the alternator on my better half's astra. Usually if you put the wrong code in beond the given number of times, it will go into a safe or wait mode. It will ned a pre determined length of time before it will let you put the code in again.
Remember that the time is on one block e.g 1 hour, so that is 1 hour unninterupted, not on for 30 mins twice.
Short of that, main dealers should carry a master code to overide the lockout. Or find a scallywag to unlock it for you.
Sorry cant give you more specific details.