add chatdialog code template

options dialog finally handles closing/deleting properly, whew!

and it handles hitting escape when it's open even!