And if I'm importing private key to some kind of wallet software, how wallet determines which address to scan on blockchain and which balance to consider as wallet's balance?/
I believe it depends on the wallet software. So older wallets will be looking for outputs on your legacy outputs, wallets with segwit support will probably scan segwit P2SH addresses (possibly also legacy outputs, depending on the wallet, I don't think many do, if any). So far, the latest version of Electrum is the only wallet I know that supports Bech32, although I might be wrong/outdated on that. And as far as multisig, your wallet would definitely have to be explicitly looking for multisig funds.
AFAIK there shouldn't be any security risks from using the same private key for multiple types of addresses, as the key is just a way to sign a transaction for an output where it can provide the required information to spend with. That said, I still wouldn't do it because it just feels wrong to me. If you want to look into it more, [ur=https://en.bitcoin.it/wiki/Script]here is the page on the Bitcoin wiki detailing the script system[/url]. It explains how standard (legacy) transactions work, and also script transactions, and all the various opcodes. It's good reading if the technical details are interesting to you.