TL;DR Studies show that this behavior is not uncommon in fully committed soldiers on the battlefield and related to obedience and following orders. There are also examples of contradicting behavior as deserting the post or charging into a fight.
Let me refer to the question of 'Why was he so devoted to note-taking?' as a broader issue not related to the fact of being human, dwarf or any other species nor to the books or films.
This is a question about the behavior of soldiers in battlefields and to answer that we first need to understand the psychology of a soldier in a battlefield, and this is not an easy thing to understand.
Many studies conducted during the last century on human soldiers in battlefields and we can, to some extent, drew conclusions on other humanoid species as this is an universal issue.
First of all let me state that, in my opinion, every man in a battlefield is fighting - it dose not matter if he carries a sword or a quill. Each has its own responsibilities and standing orders. There is no question here about Ori's abilities as a fighting soldier as Ori fought in the Battle of Five Armies and lived to tell about it... So why was he writing and not fighting?
As @Rand al'Thor stated in his answer, Ori was, probably, fighting. But could (or should) he have been writing to the very last minute? Or, if it ware any other dwarf behind the quill - could he have been writing to the very last minute?
In a paper The Psychology of the Soldier in the Battlefield (Major-General J. McGhie QHP, MD, FRCPsych, DPMa in the RUSI Journal Volume 118, Issue 2, 1973, pages 39-42):
... by constant drilling and discipline the soldier was taught to obey the word of command instinctively. He was not expected to think for himself, only to react automatically. Anyone who showed signs of nervousness by disobeying an order or by running away was dealt with summarily and given no further opportunity of repeating his misdemeanor...
This is how military worked for many years and only
During the 1914 War this rigid attitude began to be questioned...
So, lets assume a soldier is given a command to keep on writing the combat log, most of the time this soldier is given all the information from his peers, he knows the statues of the combat to the smallest detail, he knows if the army is losing or winning. And now, they are losing. Will he fight? Will he write? Will he take flight?
It's hard to tell. And there are examples for each of these.
Some would take flight or just snap...
New York Times - When Soldiers Snap, By ERICA GOODENOV. 7, 2009
The case of Maj. Nidal Malik Hasan, Army psychiatrist, who military officials said gunned down dozens of soldiers at Fort Hood, Tex:
Major Hasan was being sent not to fight, but to join those ranks of doctors who, over centuries of war, have worried about breaking points — how much fear and tedium soldiers can take; how long they can slog through deserts or over mountains; how much blood they can see, how many comrades they can lose — and have sought ways to salve the troops’ psychic wounds and keep them fighting...
Over the centuries, soldiers have often broken under such stress, and in modern times each generation of psychiatrists has felt it was closer to understanding what makes soldiers break. But each generation has also been confounded by the unpredictability with which aggressions sometimes explode, in a fury no one sees coming.
He was not a combat soldier. He was a doctor, and in the call for duty - he could not coup. Can we judge him? Who knows what goes in the mind of a man on a battlefield? and he was a psychiatrist...
Some could leave their post and fight, and even change the outcome of the fight.
I will give here a sample from fiction Game of Thrones (season 4) The Watchers on the Wall (spoilers...):
Olly is a small teenager in charge of the lift to the top of the wall. During the battle in Castle Black, Ygritte confronts Jon Snow but hesitates with her arrow. Her pause allows Olly, who deserted his post, to shoot her in the back, and she dies in Jon's arms.
And some will keep on writing to the last minute...
Let me get you into the mood of a battle...
David Langbart, Archivist at the National Archives in College Park:
The Death of a Lady: The USS Lexington (CV-2) at the Battle of the Coral Sea, Part I: The Log - February 9, 2016. Can be found here.
After the December 7, 1941, attack on Pearl Harbor, imperial Japanese forces seemed unstoppable, winning battle after battle in the Philippines, and other places in the Pacific...
By mid-April 1942, U.S. naval planners had determined that the Japanese planned to continue their expansion south and conquer the Coral Sea as part of a plan to capture all of New Guinea.
To counter that move, the U.S. established Task Force 17, a two-carrier naval force centered on the USS Yorktown (Captain Elliott Buckmaster) and the USS Lexington (Captain Frederick C. Sherman)....
... The Japanese experienced early success...
... On May 5 and 6, the opposing forces searched for each other. May 7 was a day of maneuvering and long-distance skirmishing, including the sinking of the Japanese light carrier Shoho, leaving two heavy carriers intact. The main action of the Battle of the Coral Sea took place on May 8, 1942, coincidentally just two days after the last American forces in the Philippines surrendered to overwhelming Japanese forces. The opposing carrier groups located each other and launched attacks. The Japanese had the advantage due to weather conditions. American planes could not locate one Japanese carrier but damaged the second enough to put it out of action. The Japanese attack, however, was more successful. The Yorktown took one bomb hit. The story on the Lexington was very different.
On the Lexington the Officer Of the Bridge was in charge of the Lexington‘s log among other duties. The devotion on keeping a minute to minute detailed log enabled researchers to study this important battle years later. The officer probably didn't know if he was going to survive yet he kept on writing:
- First enemy aircraft seen on port bow. As first torpedo was seen to drop rudder was put full right.
1116 Gunfire opened on enemy. Speed increased to 30 knots. Torpedo planes seen on starboard bow, rudder was put full left but before ship started to swing left, rudder was again put full right.
1118 Torpedo hit port side about frame 50.
1120 Heavy hit by torpedo about frame 72 port side.
1120½ Torpedo hit port side near bow. Shock of second hit broke siren pull cord, jammed siren valve open.
- Near miss bomb port side about frame 50.
1122 Torpedo hit near water line port side about frame 100. A bomb hit on flight deck port side near frame 60 . . . . Ship took up a list to port of about 6◦. A bomb hit near after end of stack, penetrated, and exploded inside stack. A near miss bomb exploded off port side near frame 135.
1130 Report of damage gave boilers 2, 4, 6 out of commission, speed reduced to 25 knots. Ready service ammunition after end #2 gun gallery burning but fire there being extinguished using Amdyco equipment. Ship turned to the right . . . .
1133 One plane landing went over side – pilot . . . and passenger . . . picked up by U.S.S. Morris.
... cont...
1158 Steadied on course. . . . Repair parties inspecting and repairing damage.
1200 Steaming as before . . . at 20 knots. Both elevators out of commission in up position. List all removed from ship by shifting fluids.
... cont...
1247 Heavy explosion felt which vented up forward bomb elevator. Lost communication with central station.
And kept this up until these last commands:
1706 A steam explosion rose on port bow.
1707 Rear Admiral A.W. Fitch directed The Captain to have the ship abandoned.
1710 Order passed “All Hands abandon ship.”

He later added:
All injured men on flight deck were lowered over the side to boats and life rafts. . . . Captain [Sherman] proceeded to inspect flight deck aft and after insuring all had abandoned, was last to leave going down a rope at stern about 1830 after several terrific explosions had scattered flames and debris over a large area of water.
So, as you can see the dwarf's behavior can be seen as logical in this situation in proper perspective.