As I said, that demo uses the undocumented version of the command which gives you greater access to the textures and states used by DirectX - and enables you to use all of the blending modes supported by DBPro.
My understanding of the blending commands used by DBPro is as follows.
The extra 4 arguments enable you to specify which of the three "surfaces" available to DirectX during a blending stage will be used and where the output will be sent. Blend mode 26, i.e. D3DTOP_LERP, requires all 3 surfaces whereas most of the modes require only two. The documented versions of the command only use two of these, D3DTA_TEXTURE and D3DTA_CURRENT but this "behind the scenes" stuff is hidden from the user.
The standard documented versions of the
set blend mapping on command blend the contents of the DirectX surface D3DTA_CURRENT with the contents of the surface D3DTA_TEXTURE in some way. In DBPro D3DTA_CURRENT is initialised with the diffuse lighting at the start of blending stage 0 (DirectX9 uses 8 blending stages in sequence from stage 0 to stage 7). In subsequent stages D3DTA_CURRENT consists of the output of the previous stage. The surface D3DTA_TEXTURE corresponds to the image specified in the documented versions of the blending command.
Blend mode 26, however, requires 3 surfaces for the blending. The undocumented version enables the programmer to access a third surface, D3DTA_TEMP so the blending operation can combine 3 surfaces using a lerping operation. Lee's blending code in the LerpingTextures snippet does this by temporarily storing one of the three textures in the D3DTA_TEMP surface:
set blend mapping on 2,0,3,3,D3DTOP_SELECTARG1,D3DTA_TEXTURE,-1,-1,D3DTA_TEMP : rem copy mask texture into TEMP
What's going on there? The blend mode is D3DTOP_SELECTARG1 which tells DirectX to use the contents of ARG1 as the stored output of that stage. The three arguments available to DirectX are specified in the next three arguments of the DBPro command, i.e. "D3DTA_TEXTURE,-1,-1" in that line of code. The two "-1"s merely indicate that the DirectX surfaces ARG2 and ARG3 are not required in that stage and ARG1 is the contents of D3DTA_TEXTURE which is the image specified in the DBPro command, i.e. image 3 (the lerping texture) in this instance. The 9th and final argument tells DirectX to put the result of the blending stage into D3DTA_TEMP instead of the default D3DTA_CURRENT.
The next line performs blending stage 1:
set blend mapping on 2,1,1,3,D3DTOP_SELECTARG1,D3DTA_TEXTURE,-1,-1,D3DTA_CURRENT : rem copy A into current
This is similar to stage 0 except it stores the contents of image 1 into D3DTA_CURRENT.
So at the end of stage 1 DirectX has two surfaces filled with images you need for the lerping operation.
The next stage enables you to combine these two surfaces with the third image i.e. image 2:
set blend mapping on 2,2,2,3,D3DTOP_LERP,D3DTA_TEXTURE,D3DTA_CURRENT,D3DTA_TEMP,D3DTA_CURRENT : rem lerp A and B, using TEMP
In that line ARG1 is specified as D3DTA_TEXTURE which in turn is specified as image 2. ARG2 is specified as D3DTA_CURRENT i.e. image 1 from the previous stage. ARG3 is specified as D3DTA_TEMP which was previously filled with the lerping texture image 3. The final argument merely tells DirectX to put the result of the blending into the usual place, i.e. D3DTA_CURRENT which is the final blended texture.
The formula used by the lerping mode 26 is (according to the DirectX SDK - see note at end

):
Quote: "D3DTOP_LERP
Linearly interpolates between the second and third source arguments by a proportion specified in the first source argument.
SRGBA = (Arg1) * Arg2 + (1- Arg1) * Arg3.
"
So, in your heightmap case the heightmap would be the lerping texture and the others would be grass and rock (or the other way round

).
Note: The DX9 documentation seems to differ from my explanation above, i.e. my explanation (and Lee's snippet) seems to suggest the formula ought to be
SRGBA = (Arg3) * Arg2 + (1- Arg3) * Arg1
or perhaps (

)
SRGBA = (Arg3) * Arg1 + (1- Arg3) * Arg2
The blending is done per colour component, i.e. RGBA.
A little bit of experimentation might tell you what you need to know.
I've tried to find Lee's original emails where we discussed this but I can't find one where he gives the new syntax explicitly and I've gleaned the above by "reading between the lines" of our remaining correspondence.