Trying to publish a little bit of Javascript on the homepage AND at the bottom

You can use the functions is_front_page() or is_home() depending on what your home page is.
Also instead of wp_head you can use wp_enqueue_scripts
Your code will look something like this

function add_inline_script() {
    if(is_home() || is_front_page)
    wp_enqueue_script('js-handler-name', 'js-url');
}
add_action( 'wp_enqueue_scripts', 'add_inline_script');

error code: 523