How do I add JS files inside libraries conditionally based on versions of IE7 and IE8?
You have the right idea. You can do what you've done for IE7 with IE8 as well.

js:
  js/script7.js: { browsers: { IE: 'IE 7', '!IE': false } }
  js/script8.js: { browsers: { IE: 'IE 8', '!IE': false } }