Custom js added with drupal_add_js doesn't actually get added if I enable "Aggregate JavaScript files" or "Cache blocks"
Is the site in D7 or D8/9?
Because in 8+ you should use  #attached instead of drupal_add_js/css