The post your are replying to was talking about European collective involvements, not the UK individually: European nations have not been collective protagonists in any major wars since WW2 - our involvement in the Middle East was largely as a result of the US triggering Article 5.
And no, the US did not publically ask to trigger article 5 but they were the beneficiary of it when NATO invoked it on their behalf after 9/11 and if you think that wasn't done in agreement and likely as a result of US diplomatic pressure behind the scenes, then you need to understand more about how geopolitics is handled outside of the public eye.
That triggering of article 5, the only time it has ever happened, was the opening salvo of the war on terror.
The US chose not to take full benefit of NATO command in their response opting instead to lead the 'coalition of the willing' which also included non-NATO countries because they believed it to be less restrictive (and they are control freaks).
Even though they didn't go for centralised NATO command until 2003 when they wanted to switch their focus to Iraq, the triggering of article 5 did provide them with a lot of additional support and resources including domestic and foreign surveillance and maritime patrols that they wouldn't necessarily have got otherwise.
The 2003 invasion of Iraq was not directly related to the article five invocation and many NATO nations, including, most famously France, but also Germany, who refused to take part, so therefore can't be classed as collective action by European nations.
And yes, Afghanistan is not part of the Middle East in pure geographic terms, but it was included as part of the 'Greater Middle East' in geopolitical terms after 9/11 by the US. It has become synonymous with the region in wider geopolitics, which along with sharing the similar developmental challenges and culture with the geographical middle east, led to the World Bank reclassifying Afghanistan and Pakistan as MENA (now MENAAP) for administrative purposes last year.