He certainly played up to the role, presumably for egotistical reasons, but most of it was sabre rattling bravado. He wasn’t seen as a genuine threat by Western intelligence agencies.
Also, NATO forces didn’t have to kill Gaddafi directly in order to be instrumental to his deposition. Their air strikes were highly effective in destabilizing the regime and empowering opposition forces within Libya. Besides, you only have to look at the history of US intervention in Latin America for many examples of how regime change can be carried out via proxies and rebel groups.