How to execute init or woocommerce_init only for checkout page

At first I will notice that logging in with the username only sounds like a insecure solution .

You should not display the form in the init action hook. Add form display function
to the action hook from checkout page (e.g. woocommerce_before_checkout_form)
or overwrite the checkout template in the active theme and insert the form there.

if ( ! is_user_logged_in() )
{
    ?>
    <form method="post" action="<?php echo esc_attr( admin_url('admin-post.php') ); ?>">
        <input type="hidden" name="action" value="custsign" />
        <?php wp_nonce_field( 'customer_signin' ); ?>
        <input type="text" class="woocommerce-Input woocommerce-Input--text input-text" 
            name="username" id="username" autocomplete="username" 
            value="<?php echo ( ! empty( $_POST['username'] ) ) ? esc_attr( wp_unslash( $_POST['username'] ) ) : ''; ?>" />
        <button type="submit" class="woocommerce-Button button woocommerce-form-login__submit" 
            name="login" value="<?php esc_attr_e( 'Log in', 'woocommerce' ); ?>"><?php esc_html_e( 'Log in', 'woocommerce' ); ?></button>
    </form>
    <?php
}

Process the form (data validation, logging in, redirection) in the admin_post_nopriv_{action} action hook. It is recommended to add nonce to the form.

add_action( 'admin_post_nopriv_custsign', 'customer_login');
function customer_login()
{
    $return_url = wc_get_checkout_url();
    if ( !isset( $_POST['username'] ) || empty($_POST['username']) ) 
        wp_redirect( $return_url );

    $nonce = wp_verify_nonce( $_POST['_wpnonce'], 'customer_signin' );
    if ( false === $nonce )
    {
        // invalid nonce
        wp_redirect( $return_url );
    }
    else {
        $uname = sanitize_user( $_POST['username'], true );
        $uid = username_exists( $uname );
        //
        // your permission checking code
        //
        if ( $uid !== false )
            wp_set_auth_cookie( $uid );
    }
    // back to order
    wp_redirect( $return_url );
}

By adding “nonce” to the form, which is sent by an unlogged user, you will probably need to use the nonce_user_logged_out action hook for verification to work. Attach to this hook a function that returns a value instead of the user ID. Due to the Woocommerce, ID of the unlogged user when calculating the nonce will not be the same in admin_post_nopriv_{$action} and displayed form.

add_filter ( 'nonce_user_logged_out', 'unlogged_user_nonce', 20, 2 );
function unlogged_user_nonce( $uid, $action )
{
    if ( 'customer_signin' == $action)
    {
        // generate returned value, for example:
        //
        // $uid = hash( 'sha1', $action );
        // 
    }
    return $uid;
}