-- Close every window whose name contains neither StringVar1 nor StringVar2.
tell application "Terminal" to close (every window whose name does not contain StringVar1 and name does not contain StringVar2)
-- Close every window whose name either doesn't contain StringVar1 or doesn't contain StringVar2.
tell application "Terminal" to close (every window whose name does not contain StringVar1 or name does not contain StringVar2)