The declassification and online release Monday of the full original version of the Pentagon Papers – the 7,000-page top secret Pentagon study of US decision-making in Vietnam 1945-67 – comes 40 years after I gave it to 19 newspapers and to Senator Mike Gravel (minus volumes on negotiations, which I had given only to the Senate foreign relations committee). Gravel entered what I had given him in the congressional record and later published nearly all of it with Beacon Press. Together with the newspaper coverage and a government printing office (GPO) edition that was heavily redacted but overlapped the Senator Gravel edition, most of the material has been available to the public and scholars since 1971. (The negotiation volumes were declassified some years ago; the Senate, if not the Pentagon, should have released them no later than the end of the war in 1975.)

In other words, today's declassification of the whole study comes 36 to 40 years overdue. Yet, unfortunately, it happens to be peculiarly timely that this study gets attention and goes online just now. That's because we're mired again in wars – especially in Afghanistan – remarkably similar to the 30-year conflict in Vietnam, and we don't have comparable documentation and insider analysis to enlighten us on how we got here and where it's likely to go.

What we need released this month are the Pentagon Papers of Iraq and Afghanistan (and Pakistan, Yemen and Libya). We're not likely to get them; they probably don't yet exist, at least in the useful form of the earlier ones. But the original studies on Vietnam are a surprisingly not-bad substitute, definitely worth learning from.

Yes, the languages and ethnicities that we don't understand are different in the Middle East from those in Vietnam; the climate, terrain and types of ambushes are very different. But as the accounts in the Pentagon Papers explain, we face the same futile effort in Afghanistan to find and destroy nationalist guerrillas or to get them to quit fighting foreign invaders (now us) and the corrupt, ill-motivated, dope-dealing despots we support. As in Vietnam, the more troops we deploy and the more adversaries we kill (along with civilians), the quicker their losses are made good and the more their ranks grow, since it's our very presence, our operations and our support of a regime without legitimacy that is the prime basis for their recruiting.

As for Washington, the accounts of recurrent decisions to escalate in the Pentagon Papers read like an extended prequel to Bob Woodward's book last year, Obama's War, on the prolonged internal controversies that preceded the president's decisions to triple the size of our forces in Afghanistan. (Woodward's book, too, is based on top secret leaks. Unfortunately, these came out after the decisions had been made, and without accompanying documentation: which it is still not too late for Woodward or his sources to give to WikiLeaks.)

In accounts of wars 40 years and half a world apart, we read of the same irresponsible, self-serving presidential and congressional objectives in prolonging and escalating an unwinnable conflict: namely, the need not to be charged with weakness by political rivals, or with losing a war that a few feckless or ambitious generals foolishly claim can be won. Putting the policy-making and the field realities together, we see the same prospect of endless, bloody stalemate – unless and until, under public pressure, Congress threatens to cut off the money (as in 1972-73), forcing the executive into a negotiated withdrawal.

To motivate voters and Congress to extricate us from these presidential wars, we need the Pentagon Papers of the Middle East wars right now. Not 40 years in the future. Not after even two or three more years of further commitment to stalemated and unjustifiable wars.

Yet, we're not likely to get these ever within the time frame they're needed. The WikiLeaks' unauthorised disclosures of the last year are the first in 40 years to approach the scale of the Pentagon Papers (and even surpass them in quantity and timeliness). But unfortunately, the courageous source of these secret, field-level reports – Private Bradley Manning is the one accused, though that remains to be proven in court – did not have access to top secret, high-level recommendations, estimates and decisions.

Very, very few of those who do have such access are willing to risk their clearances and careers – and the growing possibility (under President Obama) of prosecution – by documenting to Congress and the public even policies that they personally believe are disastrous and wrongly kept secret and lied about. I was one – and far from alone – with such access and such views, as a special assistant to the assistant secretary of defence for international security affairs in the Pentagon in 1964-65. (My immediate boss John T McNaughton, Robert McNamara's primary assistant on Vietnam, was another; as documented in the recent publication of his personal diary.)

I've long regretted that it didn't even occur to me, in August 1964, to release the documents in my Pentagon safe giving the lie to claims of an "unequivocal, unprovoked" (unreal) attack on our destroyers in the Tonkin Gulf: precursors of the "evidence beyond any doubt" of nonexistent WMDs in Iraq, which manipulated Congress, once again, to pass the exact counterpart of the Tonkin Gulf resolution.

Senator Morse – one of the two senators who had voted against that unconstitutional, undated blank cheque for presidential war in 1964 – told me that if I had provided him with that evidence at the time (instead of 1969, when I finally provided it to the senate foreign relations committee, on which he had served): "The Tonkin Gulf resolution would never have gotten out of committee; and if it had been brought to the floor, it would have been voted down."

That's a heavy burden for me to bear: especially when I reflect that, by September, I had a drawer-full of the top secret documents (again, regrettably, not published until 1971) proving the fraudulence of Johnson's promises of "no wider war" in his election campaign, and his actual determination to escalate a war that he privately and realistically regarded as unwinnable.

Had I or one of the scores of other officials who had the same high-level information acted then on our oath of office – which was not an oath to obey the president, nor to keep the secret that he was violating his own sworn obligations, but solely an oath "to support and defend the constitution of the United States" – that terrible war might well have been averted altogether. But to hope to have that effect, we would have needed to disclose the documents when they were current, before the escalation – not five or seven, or even two, years after the fateful commitments had been made.

A lesson to be drawn from reading the Pentagon Papers, knowing all that followed or has come out in the years since, is this. To those in the Pentagon, state department, the White House, CIA (and their counterparts in Britain and other Nato countries) who have similar access to mine then and foreknowledge of disastrous escalations in our wars in the Middle East, I would say:

Don't make my mistake. Don't do what I did. Don't wait until a new war has started in Iran, until more bombs have fallen in Afghanistan, in Pakistan, Libya, Iraq or Yemen. Don't wait until thousands more have died, before you go to the press and to Congress to tell the truth with documents that reveal lies or crimes or internal projections of costs and dangers. Don't wait 40 years for it to be declassified, or seven years as I did for you or someone else to leak it.

The personal risks are great. But a war's worth of lives might be saved.