Awesome refactor. I was planning on cleaning the script up eventually but you already did!
Glad you got rid of that API, it was a pain to use...
Some features I was thinking would be useful in the future:
Selling strategies. For example, when you're 5% absolute away from a target ratio or when you're 25% relative off.
Gradual ETF switching. For example, let's say that a new ETF comes around that is roughly equivalent but has a lower MER. You would only buy the new ETF and only sell the old one and the combined balance would be used to ratio calculations. Ideally you'd be able to define categories like "Canadian equity" and have a list of equivalent ETFs where the first is the highest buy priority and the last is the highest sell priority.
Tax gain/loss harvesting could likely be part of gradual switching as it would require you to define equivalent ETFs and you could harvest when switching ETFs.