The short answer is NO, GnuCash can't do that at present.
There's useful information on Scheduled Transactions in https://wiki.gnucash.org/wiki/Scheduled_Transactions - including examples of performing simple calculations directly in the register, and using variable names in formulae to have GnuCash prompt you for an input value. There's also examples of having more complicated calculations performed in the background with the result returned in the scheduled transaction.
However, under the heading formulas or scripts for periodic savings the Wiki states
What it _cannot_ do, however, is sum or obtain the values from existing accounts ... so it would not be able to compute "all expenses in the last month".
I take this to mean that GnuCash cannot retrieve the current balance of a GnuCash account and automatically use that value in a scheduled transaction. You can however, schedule a transaction that will prompt you to retrieve that value and provide it to the calculation.