How can an extension conditionally show (or hide) a block

See also How to load JavaScript or stylesheet conditionally based on admin config settings