Re: Open the can and go fishing...
One can only claim diploamtic immunity if one is a diplomat (or the wife of somone who amy or may not have diplomatic immunity). If you're just a foreign national living in another country and you get caught 'spying' then there's no immunity for you.
If you are caught spying (in the UK at least) and are a foreign diplomat then you're described as doing activities incompatible with your diplomatic status. You can be labelled as Persona Non Grata and sent home (PNG'd).