Bernout, it looks like you are getting some good ideas of what to check for, assuming the "clicking" sound is related to the problem.
However, for what it'* worth I'll pass this along: Here is what it took to fix that problem on my '99. I was told that it was most likely to be either a flakey cam position sensor, or crank position sensor. And upon visiting with a very exerienced GM shop foreman, he suggest that since the parts are relatively inexpensive, and to replace either one of them takes about the same amount of time and parts removal, he said they always replace them both at the same time.
So, that is what I did, and "presto !! problem fixed." (-I've also heard that a person should make sure there is no dirt, etc. around the "trigger windows" on the back side of the harmonic balancer. -those windows are what gives the sensor it'* position information.
By the way, when mine had that problem, it NEVER EVER set any codes. -probably because the condition never lasted long enough. It always just re-started, as if nothing ever happened.
Let us know what you find