This is very similar to GaldorPunk's response, however it would seem to be that your looking at upkeep costs over time (eg. 5 swordsman costs 20 resources per 30 seconds) with building new units being a full price purchase instantly (eg. 25 resource when click the create new swordsman button) rather than paying over a period of time (eg. 1 resource per second for 25 seconds and then nothing).
It would seem to me that you are adjusting the player's balance for income and expanses at different times. In your example your doing income every 10 secs, but not doing expenses till 30 secs.
I would suggest that both should be done at the same time and the end result applied to the player's balance. This way the player's balance will gradually go up or down rather than jumping.
For example
Initial resourse=10
1 min.: Income: +5, Expense: -5, Change: 0, Resource: 10
1 min. 10 secs: Income: +5, Expense: -5, Change: 0, Resource: 10
1 min. 20 secs: Income: +5, Expense: -5, Change: 0, Resource: 10
1 min. 30 secs: Income: +5, Expense: -5, Change: 0, Resource: 10
The expenses after 30 seconds is still 20, but it is spread across each step the same as income.
The player isn't earning any income so would not be able to purchase the 25 cost unit. The player is left with two choices 1) increase income (such as by using the moving a unit into the right position for situational income) or 2) Decrease expenses (such as by getting rid of a unit)
Continuing from the previous example, assuming player removed unit to reduce expenses
Initial resourse=10
1 min. 40 secs: Income: +5, Expense: -4, Change: +1, Resource: 11
1 min. 50 secs: Income: +5, Expense: -4, Change: +1, Resource: 12
2 min. : Income: +5, Expense: -4, Change: +1, Resource: 13
2 min. 10 secs: Income: +5, Expense: -4, Change: +1, Resource: 14
The player is now earning again so will be able to a some point purchase the 25 cost unit, but doesn't have to time it just before the expenses get removed from their balance.