Sorry for the rough answer but please feel free to ask any doubts related to the answer if it is not clear
So basically your problem can be properly analyzed in this way:
Consider we have a single cube, it has a single face diagonal
If I follow your algorithm and only notice the number of upper face diagonal, somehow it turns out for step two, for the on the top layer (h = 2 units here) now there is one upper face diagonal and in the lower layer 2 additional upper diagonals have been added, hence the new number of upper body diagonals added is 1 + 2 = 3 and the total number of upper body diagonals i.e. cubes are 4.
Repeating the step for the third time, in the uppermost layer there is a single upper face diagonal, in the second layer, there are 1+2 upper face diagonals and in the last layer there are now 1 + 2 + 3 upper face diagonals and hence the new number of cubes added would be 1 + (1+2) + (1+2+3) - 4 = 6 cubes( also 1+2+3 that is n(n+1)/2 where n is the nth step)
Now, here's what the pattern will look like when there are you apply constraints on say a 3*3 space
first step =1
second step =1 + (1+2)
third step = 1 + (1+2) + (1+2+3)
now for the fourth step, one can clearly observe that no cube can be added to the existing top layer anymore vertically and that (1+2+3) in the lowest layer implies the face diagonal of the cube(that is the 3 upper face diagonals of the unit cubes here) has been counted in the third step and hence we have to now treat the problem differently
Now clearly in the third layer one has to add 2 cubes i.e 2 upper face diagonals that is two cubes only to make sure the sides for the third step are covered across length and width
In the 2nd layer one again adds according to the algorithm and this will take care of the remaining uncovered faces of the third layer as well
In the first layer one adds 2 cubes in accordance with the algorithm and since our height is constrained we don't add an extra layer to cover the remaining uncovered faces
therefore the 4th step is : (1+2) + (1+2+3) + (1+2+3+2) and the no of new cubes added is 7
Similarly for the 5th step it is (1+2+3) + (1+2+3+2) + (1+2+3+2+1)
Note that the third layer has been completely filled in the fifth step ( 9 upper face diagonals) and the number of new cubes added is 6
For the 6th step it is (1+2+3+2) + (1+2+3+2+1) + (1+2+3+2+1)
Hence the 2nd layer has also been completely filled in the 6th step and the number of new cubes added is 3
And for the 7th step which is the last step the number of new cubes added is 1.
If you understand this method, you can fairly easily find out the number of new cubes added for each "step" for a 6*6 situation as well
For example after the 6th step the number of cubes added would be (5 for the lowest layer) + (6 for the second lowest layer) + (5 for the third lowest layer)....+ (2 for the topmost layer) and 5+ 6+ 5 + 4 +...2 + (1 - 1) = 11 + 5(5+1)/2 - 1 = 10 + 15 = 25 which is exactly what you've found out aswell.
I am extremely sorry for not being able to send an obviously much more required clearer solution to your problem as it is pretty late here in my part of the world and i have a hectic college schedule too but i will try to send a more elaborately explained solution sometime later with images if required for understanding if it is needed.
I imagined this problem as a problem of putting together squares in such a way no side was not a common side for two squares and that for each step a layer or like a plane with a square also got added which also had to follow the same constraints as the initial layer or plane of squares and somehow it just works out.
Hope this helps and please ask if you aren't able to understand something.
I am currently taking a course on probability and am somewhat interested in the subject so i am interested in how connected these two problems together so it would be my pleasure if you explained your rough idea:)