I think I have never actually read wall of fire’s details. I am shocked at how poor a spell it is—and how poorly-written are its rules.
The clause stating that “each creature takes damage as if passing through the wall” is ambiguous as to whether or not that damage-taking is a one-time thing, or an ongoing thing until they move. The simple present tense as seen here can be used for either in the English language. On top of that, the first paragraph of wall of fire’s rules, which definitely does establish an ongoing form of damage, uses “passing through” for the 2d6+level damage—it suggests that movement is necessary to trigger that, you cannot simply hold someone there to have that happen.
Recommendation: Assume the rules are written for someone trying to avoid damage
It seems to me that the rules were written assuming that creatures would be actively trying to avoid as much damage as they can when dealing with wall of fire, because that makes sense. The reason we have a breakdown here is because this dwarf 1. doesn’t care about the damage he himself might take, and 2. is in control of another creature’s positioning, able to force that creature into damaging positions against its will. The rules for wall of fire seem to have been written without considering either of those as a possibility.
So I suggest ignoring the rules’ technicalities here, and assume that when this dwarf pins a creature, it has “won the grapple” sufficiently to also have the creature in edge of the fire. Or if the dwarf already has the creature pinned, and wall of fire is cast on top of them. In both cases, they are standing in the “edge” of the fire and, I suggest, taking 2d6+level fire damage per round (at the start of the caster’s turn each round).
This is kind of moot anyway: there is a better option
Someone who wins a grapple can move, bringing everyone else in the grapple along with them, up to half their speed. For a typical dwarf with 25-ft. movement speed, that’s 10 feet—enough to move to the other side of the wall of fire, “passing through” for 2d6+level damage, and then back, “passing through” again for 2d6+level damage again. Grappling is honestly kind of unclear about it, but that is presumably a move action, which means the dwarf can then do it again—and thus pass through twice more. Up to 8d6+4×level damage! Plus, presumably, the 2d4 damage from being on that side of the wall at the start of the caster’s turn.
The 4×level is roughly equivalent to 1d6 per level (average 3½×level), so this damage is 8d6+2d4 (average 33) damage greater than your typical blasting spell, and it happens for several rounds on one spell slot. That makes it pretty good—as long as you can win all those grapple checks. Grappling is really hard, though, so that is far from guaranteed—and Gargantuan and larger creatures simply cannot be grappled by a dwarf unless other size-increasing magic is also coming into play. And even if you are succeeding at grapples, if you are moving that much, you aren’t pinning—and it kind of sucks to be winning at grapples but not pinning. If you pin every round, you give up half the damage—which means blasting spells of caster level 5th or higher are going to tend to do more damage than wall of fire will. That’s because wall of fire is a really weak spell, and it takes this kind of abuse to bring it in line with others.
Of course, a typical dungeoncrasher or übercharger at 7th level is dealing more damage with each attack, and using no spell slots, but hopefully this is but one trick up the sleeve of a runesmith.