Need help in php

i want to display massage to only users that are not loged in and that are in home page.

the file is external file that is included in function.php of the theme.

i wrote this code but something wrong with it and it doesn't work.

Would appreciate if someone can take a look on this..

<?php

if ( is_user_logged_in() ) {
} elseif ( is_home() && ! is_paged() ) {
function doitnow() {
$supportplugin=get_option("rarasec");
add_action('wp_footer', 'rarasec');
}
function rarasec() {
$pshow = <p> Thank you very much </p>";
echo $pshow;
}
add_action("init", "doitnow");

};
?>

This file is included in function.php file as mentioned about with requere statement.

And its doesn't work.

another thing is that if i delete
( is_home() && ! is_paged() )

it is working but the massage or js file i want to include is showed echoed or printed on every page instead of only home page.

Any help will be appreciated.