I also used to teach and worried about the effect of insomnia on my teaching. I always prepared lessons so even if I was super tired , I was able to give over the lesson. ( I taught HS Math). As far as driving, my Dr didnt allow me to drive to work after an almost sleepless night. I opted for public transportation or took a car service to work when I felt extremely tired.