Use an array of page template slugs and $hook

Use in_array():

if ( in_array( $hook, [ 'user-edit.php', 'profile.php' ] ) )
    // do something

Or wait for the action personal_options, and enqueue the script for the footer. This action is fired in both cases. See this old example.