How to defend in the best way vs shortstack 3bet?

I guess it doesn't make sense to call 3bet or 4bet/fold, so we have to either fold or push?
Positions are any, bet sizes, stack sizes any. Stats are any, but known! So I need general answer, not for specific scenario. I will try to derive it mathematically myself, so you can tell what is wrong, what can be improved.

1) We first calculate his call allin range. This is:
call_allin_range = 3bet_stat * (1 - 4bet_stat)

2) we calculate our hand equity vs his call allin range.

3) we calculate if push is +EV using calculated hand_equity:

EV_push = fold_vs_4bet * dead_money + (1-fold_vs_4bet) * (hand_equity * total_pot_allin - remaining_stack)

4) If our EV > 0 we push, otherwise we fold.

Is it ok approach, and do you agree that it should work for any ranges and positions?

Example:
Shorty 3bets 6bb SB vs BU open raise 2bb. Shorty has 20% depolarized 3bet range, and folds 35% vs shove. He has 25 bb stack size. Our hand is AA.

1) call_allin_range = 3bet_stat * (1 - 4bet_stat)
call_allin_range = 0.2 * (1 - 0.35) = 0.13 (13% range)

2) hand_equity of AA vs 13% range is 83%

3) EV_push = 0.35 * 9bb + (1-0.35) * (0.84 * 51bb - 23bb) = 16bb

4) Our EV is > 0, so we push.