According to Ken Brown there is one war which does use these same commands – Judges 21, which is the destruction of Jabesh-Gilead:
Some argue that Judges 21 is older, and that Num 31:14-18 uses it to reinterpret Deut 20:10- 18 (e.g., Achenbach, Die Vollendung der Tora, 615, 620; Seebass, Numeri, 3:296, 304, 317), while Edenburg suggests that originally Judg 21 did not recount the destruction of Jabesh-Gilead, and that 21:2-5, 10-11 + 126 are secondary and dependent on Num 31 (“Story of the Outrage,” 96-97,303-10; cf. also Levine, Numbers, 2:466; Robert G. Boling, Judges: Introduction, Translation, and Commentary, AB 6A [Garden City, NY: Doubleday, 1975], 291; Carolyn Pressler, Joshua, Judges, and Ruth, WeBC (Louisville: Westminster John Knox, 2002], 256; Walter Groß, Richter, HTKAT (Freiburg im Breisgau: Herder, 2009], 874). Alternatively, if the partial inn was added to both Num 31 and Judg 21 secondarily, that could imply a closer link between the final forms of these texts than simple one-sided dependence.
He also argues that it would not necessarily put Moses in a good light:
They form a deliberate pattern of command, fulfillment, and extension repeated in both halves of the chapter, and reflect back on the divergent uses of [hebrew] by YHWH and Moses at its outset. Moses emphasized vengeance or retribution on the enemy in 31:3, and his call for slaughter continues that interpretation. But YHWH emphasized the vindication or redress of Israel itself in 31:2, and the overwhelming emphasis on the proper handling of the plunder in the rest of the chapter maintains that focus. […] Perhaps, one might argue, both Moses’s command and the officers’ gift are meant to reveal complementary reactions to YnwH’s [hebrew], much as Isa 34-35 paired the punitive and redemptive connotations of [hebrew], but the larger shape of the chapter implies a sharper contrast. For in the end Moses’s call for slaughter remains unfulfilled, while the officers’ gift secures a permanent “memorial for the Israelites before YwH.” (See: https://www.jstor.org/stable/10.15699/jbl.1341.2015.2561)