I have a few questions about blockchain compatibility.
I think it should be possible to copy a whole blockchain into a new crypto currency, with all the keys and transactions, so that you can restore your transaction history and balances by importing your private key into the new wallet. Is that correct?
Sure. You'd need to import all the private keys from the original wallet (unless you were using a wallet that has deterministic keys, such as Electrum in which case you'd need to import the seed).
If yes, could one modify the blockchain to erase unwanted transactions and move balances into nirvana?
In your newly created altcoin? Sure. There are a variety of ways you could maintain balances that you want, and remove balances you don't want.
Danny might be correct in the sense you care about. However, you really can't arbitrarily modify blocks within the blockchain because every block contains the hash of the prior block. This is why its called a "chain". So if you modify one in the middle, the hash will no longer match up. But this is code, so you *could* add an exception to your altcoin block validation tool, allowing this broken hash...
But it might be better to create a one-time "fork" block that would adjust balances in any manner you choose. It is code after all...
Another noob question: If a wallet has multiple addresses, is it possible to tell if they are belonging together or do they all have individual keys, or in other words - can you restore the actual wallet balances?
The addresses all have individual keys. The only way to restore entire balance would be to have all the private keys from the original wallet.
Is it possible to send coins using a secondary address, or will they always be sent with the main address?
Bitcoins aren't sent "with and address" They are sent "to an address". You can choose what address you want to send them to.
(Actually, they are sent to scripts. There is a particular commonly used script that encumbers spending with a signature from a private key of an address. This commonly used script is called "sending to an address" as a common way to describe it)
When spending them, you spend the specific previously received outputs by satisfying the script (which in the case of bitcoins "sent to an address" means providing a valid digital signature).
I think that when people speak about "sending bitcoins from an address" the "from" address IS "the specific previously received outputs". So you can't choose an arbitrary "from" address, but using the "coin control" feature in the 0.9.1 version of Bitcoin core you CAN pick which previously received outputs to use for a particular send. Other wallets, like armory let you keep multiple separate "wallets" within the same program. Coins from both wallets are never spent in the same transaction.
Some more off topic question about 51% attacks:
Afaik you can take over a chain if you have the longest one in the network (chains, i'm talking about chains!).
As long as your chain satisfies the other requirements of the protocol? Sure.
Would it be possible to speed up the calculation of the chain for such an attack by modifying the block time in the source code and then start calculating, so that you can override far into the past until the last checkpoint?
No.
Also, although people say the "longest" chain, its really (AFAIK) the "most difficult" that is chosen. For all normal cases these two concepts are the same but this is why an attacker can't hack the code to artificially reduce the difficulty to 1, create a chain longer than the rest of the network and have everyone switch over.