He represented the Tauranga electorate in Parliament from 1972 to 1984, when he died, immediately after the 1984 election. Allen was replaced in the seat by Winston Peters. In August 1983 there had been controversy over claims by Allen that he had been attacked while walking through the city at night. It was reported he had diabetes, and some concluded he may have been hallucinating or was intoxicated. A detailed account of the Keith Allen affair is provided by Sir Robert Muldoon in his book "Number 8" on page 154. In it he discusses the intrigues surrounding Allen's claim that he had been assaulted, the media fracas and a leaked medical report. What Muldoon doesn't state is that Allen was finding the job of a cabinet minister stressful and wanted to resign. Muldoon would not accept his resignation, according to Barry Gustafson in his biography on Muldoon entitled "His Way". In the documentary "Muldoon: The Grim Face of Power" reference is made to these events. It is claimed that National's Senior WhipDon McKinnon met Muldoon on Keith Allen's behalf to explain that Allen wanted out of the Cabinet and wished to retire at the next election. Muldoon retorted: "You look after the back benchers and I'll look after the Ministers. You keep away from Keith Allen". Hugh Templeton wrote that Allen announced his decision to retire in March 1984, and told Templeton he had diabetes; Templeton consulted an endocrinologist friend who raised the possibility of hypoglycaemia which could explain episodes of unusual behavior, and when consulted by Allen discovered that his diabetic medication was double the upper dose limit. With help from the specialist Allen could attend cabinet meetings again in late April. But Muldoon told Templeton, deputy Jim McLay and chief whip Don McKinnon that the minister was his problem not theirs. On 19 July 1984 after caucus met for the last time after losing the snap election, Templeton called out to Allen as they left the Beehive:
See you on Monday. He went home to Tauranga to an empty house. His marriage had broken down under the strain of politics and diabetes. Blaming himself for Muldoon’s troubles and our defeat, he drank a bottle of vodka. Next morning his close friend, Peter Barry of the Wool Board, rang to tell me that Keith had died. I observed many casualties of politics, but none more obviously a victim of Muldoon’s desire for power. Now I can see it as a sad requiem in the Muldoon era.