I don’t understand your “optimum level” concept. I approached the math a little differently. I simply calculated the incremental cost per stat point for each individual transaction and then sorted the transactions in ascending order. Then I grouped transactions together with their more expensive (per stat point) prerequisites if they had any. I also grouped consecutive transactions together if they had a prerequisite relationship. I matched up with your purchase guide with a few exceptions up until the Abyss/Osmon Rai unlock. After that point, I couldn’t find a good correlation.
All calculations have been done using the Balanced Troop building and it is assumed the results can be applied to all building types. For Lowlands and Highlands, the highest available building tier for each map was used for the calculations. Upgrades listed with multiple level increases should be done vertically (one Land at a time) not horizontally (one Level at a time). The numbers preceding each upgrade combination are the calculated cost in gold per stat point.
For the sake of being thorough, I added Lowlands at the beginning:
12,669 – Lowlands: Land 2 to Land 25 (Level 1)
27,586 – Highlands: Land 1 to Land 2 (Level 1)
29,551 – Lowlands: Upgrade all buildings to Level 3 (Lands 2-25), Lowlands build complete
Hoarfrost Land 1 + Level 1 (57,764) is a better value than Highlands Level 2 (71,971), so it would be more efficient to hold on Highlands Level 2 and Level 3 until after Highlands Land 15 (Hoarfrost unlock).
136,915 – Highlands: Land 3 to Land 15 (Level 1), Hoarfrost unlock
61,776 – Hoarfrost: Land 1 to Land 2 (Level 1)
71,971 – Highlands: Upgrade all buildings to Level 2 (Lands 1-15)
90,497 – Hoarfrost: Land 3 to Land 5 (Level 1)
111,930 – Highlands: Upgrade all buildings to Level 3 (Lands 1-15)
Hoarfrost Level 2 (119,170) is a better value than Hoarfrost Land 6 + Level 1 (121,947), so it would be more efficient to upgrade to Level 2 after Hoarfrost Land 5 rather than Land 8:
119,170 – Hoarfrost: Upgrade all buildings to Level 2 (Lands 1-5)
178,333 – Hoarfrost: Land 6 to Land 11 (Level 2)
Hoarfrost Land 11 + Levels 1-2 (246,120) is a better value than Highland Land 16 + Levels 1-3 (250,535).
282,518 – Hghlands: Land 16 to Land 18 (Levels 1-3)
Hoarfrost Land 12 + Levels 1-2 (308,693) is a better value than Highland Land 19 + Levels 1-3 (314,502).
308,693 – Hoarfrost: Land 12 (Levels 1-2)
335,824 – Highlands: Land 19 to Land 20 (Levels 1-3)
371,266 – Hoarfrost: Land 13 (Levels 1-2)
Highlands Level 4 (375,845) is a better value than both Highlands Land 21 + Levels 1-3 (399,790) and Abyss Land 1 + Level 1 (402,638), so it would be more efficient to upgrade to Level 4 after Hoarfrost Land 13 rather than wait until both Abyss and Osmon Rai are build complete (!?!?!):
375,845 – Highlands: Upgrade all buildings to Level 4 (Lands 1-20)
394,707 – Highlands: Land 21 (Levels 1-4)
Abyss Land 1 + Level 1 (402,638) is a better value than Highlands Land 22 + Levels 1-4 (411,503), so it would be more efficient to hold on Highlands Land 22 until after Hoarfrost Land 15 (Abyss & Osmon Rai unlock).
485,984 – Hoarfrost: Land 14 to Land 15 (Levels 1-2), Abyss & Osmon Rai unlock
402,638 – Abyss: Land 1 (Level 1)
Highlands Land 22 + Levels 1-4 (411,503) and Hoarfrost Level 3 (440,141) are both better values than Abyss Land 2 + Level 1 (473,691).
411,503 – Highlands: Land 22 (Levels 1-4)
440,141 – Hoarfrost: Upgrade all buildings to Level 3 (Lands 1-15)
473,691 – Abyss: Land 2 (Level 1)
Highlands Land 23 + Levels 1-4 (478,687) is a better value than Osmon Rai Land 1 + Level 1 (533,753).
478,687 – Highlands: Land 23 (Levels 1-4)
533,753 – Osmon Rai: Land 1 (Level 1)
Osmon Rai Levels 2-4 (770,959) is far less efficient than just about any other option at this point. Osmon Rai Level 2 (602,526) should happen after Abyss Land 3 + Level 1 (544,745) and Highlands Land 24 + Levels 1-4 (545,872). Osmon Rai Level 3 (777,960) should happen after Abyss Land 8 + Levels 1-6 (699,921). Osmon Rai Level 4 (824,896) should happen after Hoarfrost Land 18 + Levels 1-5 (801,887).
544,745 – Abyss: Land 3 (Level 1)
545,872 – Highlands: Land 24 (Levels 1-4)
602,526 – Osmon Rai: Level 2 (Land 1)
615,331 – Osmon Rai: Land 2 (Levels 1-2)
Osmon Rai Land 3 + Levels 1-2 (681,259) should not happen until after Abyss Land 5 + Levels 1-6 (674,269). Abyss Levels 2-6 (650,290) should not happen until after Hoarfrost Land 16 + Levels 1-3 (620,531), Highlands Land 25 + Levels 1-4 (629,852), and Hoarfrost Level 4 (631,134). Abyss Levels 7-10 (835,783) should not happen until after Hoarfrost Levels 6-7 (832,164).
615,799 – Abyss: Land 4 (Level 1)
Osmon Rai Land 4 + Levels 1-3 (785,904) should not happen until after Osmon Rai Level 3 (777,960). Osmon Rai Levels 5-8 (960,502) should not happen until after Hoarfrost Land 20 + Levels 1-10 (959,402). At this point everything is sufficiently scrambled in your guide, so I will list the remainder in the order that I came up with:
620,531 – Hoarfrost: Land 16 (Levels 1-3)
629,852 – Highlands: Land 25 (Levels 1-4), Highlands build complete
631,134 – Hoarfrost: Upgrade all buildings to Level 4 (Lands 1-16)
650,290 – Abyss: Upgrade all buildings to Level 6 (Lands 1-4)
674,269 – Abyss: Land 5 (Levels 1-6)
681,259 – Osmon Rai: Land 3 (Levels 1-2)
683,402 – Hoarfrost: Upgrade all buildings to Level 5 (Lands 1-16)
699,921 – Abyss: Land 6 (Levels 1-6)
723,709 – Hoarfrost: Land 17 (Levels 1-5)
743,895 – Abyss: Land 7 to Land 8 (Levels 1-6)
777,960 – Osmon Rai: Upgrade all buildings to Level 3 (Lands 1-3)
785,094 – Osmon Rai: Land 4 (Levels 1-3)
798,863 – Abyss: Land 9 (Levels 1-6)
801,887 – Hoarfrost: Land 18 (Levels 1-5)
824,896 – Osmon Rai: Upgrade all buildings to Level 4 (Lands 1-4)
832,164 – Hoarfrost: Upgrade all buildings to Level 7 (Lands 1-18)
835,783 – Abyss: Upgrade all buildings to Level 10 (Lands 1-9)
846,583 – Abyss: Land 10 (Levels 1-10)
867,331 – Osmon Rai: Land 5 (Levels 1-4)
868,346 – Abyss: Land 11 (Levels 1-10)
876,944 – Hoarfrost: Upgrade all buildings to Level 9 (Lands 1-18)
888,378 – Hoarfrost: Land 19 (Levels 1-9)
906,431 – Abyss: Land 12 to Land 13 (Levels 1-10)
939,980 – Hoarfrost: Upgrade all buildings to Level 10
959,402 – Hoarfrost: Land 20 (Levels 1-10)
960,502 – Osmon Rai: Upgrade all buildings to Level 8 (Lands 1-5)
960,839 – Abyss: Land 14 (Levels 1-10)
978,203 – Osmon Rai: Land 6 to Land 8 (Levels 1-8)
1,009,806 – Abyss: Land 15 to Land 16 (Levels 1-10)
1,034,641 – Osmon Rai: Land 9 to Land 10 (Levels 1-8)
1,042,450 – Abyss: Land 17 (Levels 1-10)
1,042,540 – Hoarfrost: Land 21 (Levels 1-10)
1,064,213 – Abyss: Land 18 (Levels 1-10)
1,078,951 – Osmon Rai: Land 11 (Levels 1-8)
1,085,976 – Abyss: Land 19 (Levels 1-10)
1,115,876 – Osmon Rai: Land 12 (Levels 1-8)
1,125,677 – Hoarfrost: Land 22 (Levels 1-10)
1,129,502 – Abyss: Land 20 (Levels 1-10)
1,152,801 – Osmon Rai: Land 13 (Levels 1-8)
1,167,100 – Osmon Rai: Upgrade all buildings to Level 9
1,173,028 – Abyss: Land 21 (Levels 1-10)
1,203,573 – Osmon Rai: Land 14 (Levels 1-9)
1,216,555 – Abyss: Land 22 (Levels 1-10)
1,229,598 – Hoarfrost: Land 23 (Levels 1-10)
1,248,803 – Osmon Rai: Land 15 (Levels 1-9)
1,281,844 – Abyss: Land 23 (Levels 1-10)
1,316,648 – Osmon Rai: Land 16 to Land 18 (Levels 1-9)
1,347,133 – Abyss: Land 24 (Levels 1-10)
1,361,878 – Osmon Rai: Land 19 to Land 20 (Levels 1-9)
1,375,088 – Hoarfrost: Land 24 (Levels 1-10)
1,399,570 – Osmon Rai: Land 21 to Land 23 (Levels 1-9)
1,412,422 – Abyss: Land 25 (Levels 1-10), Abyss build complete
1,425,200 – Osmon Rai: Land 24 to Land 25 (Levels 1-9)
1,443,579 – Osmon Rai: Upgrade all buildings to Level 10, Osmon Rai build complete
1,499,794 – Hoarfrost: Land 25 (Levels 1-10), Hoarfrost build complete