Hi clav,
Your description of the difficult starting with clicking is CLASSIC for a poor connection at cable to battery post, cable to starter solenoid or cable end to engine ground point.
While it could also be indicative of other connections or even a faulty cable, those three main areas are where I would begin by either disconnecting each one and wire brush cleaning....(SHINY!)....or....
....If you really want to PINPOINT the problem.....
....VOLTAGE DROP TEST each one.
Voltage drop testing is as close to "electrical magic" that most of us can get without going to engineering school but it's pretty easy and allows us to "see" things like bad connection points and broken wire strands hidden under insulation.
It is probably one of the most useful things you can do with an inexpensive digital multimeter.
BUT...
...YOU have to invest a little time reading about it and watching a YouTube video or two.
TONS AND TONS of really great things about it on the "good ol' web" and it can save you HOURS or even DAYS of work searching, disconnecting and cleaning wire ends trying to find your problem.
TIP:
Voltage drop testing only works if the circuit is being "powered up" or used.
For example....
Set the meter to DC volts and let's check the quality of the connection between the battery cable positive clamp and the battery positive post.
Place the positive meter test lead tip on the cable clamp and the negative test lead tip on the battery post. You will often get a reading that sort of "jumps" around or doesn't make any sense but that should be ignored.
Then, turn the key to "start" briefly (having a helper is advantageous) and observe what happens. There will be a STEADY reading and that reading is the voltage that is being "dropped" (or stolen) at that particular connection while the circuit is being powered or WORKING.
The reading is almost never 0 but ideally it should be. If you get a reading of, say, 0.010 volts or higher, remove and clean that connection and then make sure it's tight after reconnecting. Hopefully the reading will be closer to 0 volts when tested again.
in a perfect world "hard connections" like this should be 0 volts when volt drop tested but we all know that the world isn't perfect. So, a very low reading on some connections (less than 0.010 volts) could be acceptable.
This is just an example of how to check one specific point in a circuit. It's a good way to practice doing volt drops. You could check each and every connection in a circuit this way and you should do a few to to get the feel for what it can tell you. But there are more efficient ways to use this and a little reading will reveal those techniques if you want to learn.
One question you may have is "does it matter where I put the black lead or the red lead when testing this way"?
The answer is NO. The meter may display a + or - with the voltage drop reading but you can ignore that. Polarity isn't a concern in this case. The number is the important thing.
You must FIRST find the reason for the starting problem and then clear the IAC code to see if it returns as the poor connection issue may be the cause of that problem too.
Good luck.