If it's banned while you're still logged in - you'll remain logged in and able to use the ID. If you log out and attempt to login, it'll give you the banned notification. It'll auto-log you out after 24 hours if the ID is banned.
Your system can also freeze if the CID is banned because the System is contacting Sony's servers ("Calling home") to check if the ID is banned. If it comes back as banned, your PS3 attempts to log you out and if doesn't...you freeze.