Hi! This is a really difficult question to answer since definitions of what philosophy actually is doesn't really have a clear answer but I'll do the best that I can. I'll largely be relying on Marc Van De Mieroop's Philosophy Before the Greeks: The Pursuit of Truth in Ancient Babylonia in order to answer this question. Obviously if you want to know more I recommend reading the book, but fair warning it can get very detailed and technical to the point of being tedious at times.
(For a more direct answer, or summary of what I'm outlining here, jump to my next comment which is a reply to this one)
Let's start by listing a few definitions of what engaging in philosophy could mean. There are a few major camps for this:
1.) 'Doing' philosophy is any sort of pursuit of knowledge for its own sake. Even when it doesn't necessarily result in increased productivity, efficiency, or material gain someone, or a group of people, are theorizing or experimenting in order to gain knowledge about the world around them. This can be really anything, from tasting your booger to see if its salty, to analyzing the chemical make up of objects. There were certainly people doing this in ancient Mesopotamia, as there has been since the dawn of humanity, though I think this is a rather vague definition and certainly not what you were looking for.
2.) A more specific definition argues that 'doing' philosophy is to seek knowledge, and then categorize it, in order to better understand the world, how it functions, and the persons place within it. Philosophy is to seek to understand how and why the world functions the way it does. There were also people doing this in Mesopotamia! Primarily scribes and temple-priests, the elite class of society, who had the free time and secure income to devote their time towards pursuits outside of mere subsistence. We have evidence for this through the strong tradition of lexical lists from ancient Mesopotamia, the main topic of Van De Mieroop's book. Lexical lists first emerged in the late 4th millennium and were long lists of 'things' put down in specific order denoting a sort of ranking between subjects, occasionally separated into broad categories as well. For example one of our first texts from Mesopotamia is a professions list, which simple listed all of the jobs someone might have in their society. At the top of the list was the king, then a series of officials, skilled tradesmen, and so on. Other lists included ones recording the different types of metals and tools, the different cattle, trees and wooden objects, vessels and garments, cities, foods, plants, and even words. While this may seem mundane, it demonstrates that the scribes creating these lists were categorizing the world, placing it into hierarchies, and trying to understand it. These lists are a far cry in form from later attempts at classification, such as Aristotle's classification of animal kingdoms, they certainly exist within that same vein and show an ability to break up the world into its constituent parts in order to understand it better. Later lists would increase in complexity, becoming extremely lengthy as the scribes knowledge of the world and its categories grew.
One really cool thing is that we actually see so-called 'knowledge production' in action through these lists. While the lists may sound purely descriptive (though as mentioned at a fundamental level they weren't since they requiring the conceptualization and creation of categories and hierarchies, a non-descriptive task) we have lots of evidence of scribes 'inventing' things for the lists that don't actually exist. For example say a list is recording two fish species, a type of carp and a type of tuna, and then more specifically they are qualifying these fish with colors. So the list is going "Red carp, blue carp, yellow carp..." but then when we get to the tuna we know for a fact there was no yellow Tuna, the scribes would still record "Red Tuna, blue tuna, yellow tuna..." This is obviously really simplified and honestly kind of a poor example but I hope you get the point. This may sound really pedantic but its proof that the scribes could and would conceptualize of things that didn't exist except in thought, that they weren't just recording what they saw, but instead thinking of categories and how these categories might interact. It also demonstrates that they had a conceptualization of a world of things that existed, even if they hadn't directly observed them. There was a sort of logic that if there was yellow carp there must also be yellow tuna since both were fish.
3.) Another definition of doing philosophy may be the pursuit of metaphysical or epistemological truths. This is more the realm of questions like "Why am I here?" "How do I know I'm here?" "What happens when I die" "What is stuff?" the really ambiguous questions which make non-philosophers groan when they hear them. This is a little more difficult to say whether or not people were doing philosophy in this way. On one hand they kind of had answers to most of these questions through religion: "Why am I here, what's my purpose?" Well those are answered by myths like Gilgamesh and Atrahasis where humans are specifically created in order to take up the labor of the Igigi gods. "What happens when I die?" You go to the underworld and eat clay and sand in darkness and boredom for the rest of time :). "What is stuff?" Well according to the Enuma Elish stuff is the body of Tiamat, cut up and shaped by Marduk after slaying her. But we see deeper explorations of these sorts of questions through their narrative stories and myths as well. For example the Epic of Gilgamesh is the story of a great king grappling with his own mortality and existential dread after the death of his friend. Just because they had answers about 'What happens when you die' and the like, doesn't mean there wasn't nuance or more to explore within these topics. There wasn't much exploration of this type of philosophy because religion gave these answers, but there is also still a real and active debate about whether religion in and of itself can and should be considered a type of philosophy, so if you believe religion represents philosophy then they were certainly engaged in it.