so I was wondering since being logged in for an insane amount of time gets you flagged, is it possible that you log into one character for 3 hours then switch to a different character, does the time logged in accumulate regardless if the account is logged in?
No one can give you a definitive answer to this, and anyone who does is providing their opinion based on speculation.
I've once botted 72+ hours on one account with not even a warning. I've once botted 2 hours on one account and got it banned. Obviously, the more time you're botting, the higher chance someone reports you - so it's good practice to not bot for long and take regular breaks. But unless you've been reported and Blizzard are personally watching your online time to determine a ban, it would not accumulate.