This is a quick reply off the top of my head, with a reference this page:
http://docs.moodle.org/en/Development:Blocks
but what you probably want to do is:
1. define a capability for viewing your block
('block/blockname:view') & set the default to be true for teachers (have a look at an example in any plugin - look for db/access.php ).
2. Set the title to null and the content to null, when the user does not have that capability
(this should stop it displaying).
I may have got that a bit wrong, but hopefully that gives you a direction to start in.
EDIT: See also here:
http://docs.moodle.org/en/Development:Blocks/Appendix_A#get_content.28.29