This is a pretty neat technique I just learned about from a blog post. #OpenSSH supports changing settings depending on what an external program returns.
https://mike.place/2017/ssh-match/
So, if I want to ssh to a host that only has IPv6, automatically use a ProxyJump host if I don't have local IPv6 connectivity.
Match host ipv6only.example.com !exec "route -n get -inet6 %h"
ProxyJump dualstack.example.com