Is there a way to provide the login provision for anonymous user when anonymous commenting is enabled?
Since you want to edit something in the contact form, you can use the same  hook_form_FORM_ID_alter of my previous answer to alter the comment_form.

As you can see in the comment form all author details are in an array $form['author']. So you need to add an item to this array and move it to the top.
    

function MODULENAME_form_comment_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  // Any code you already have here

  // Check if the user was not yet logged in. (It would be useless to show this otherwise.)
  if (!user_is_logged_in()) {

    $form['author']['login_url'] = array(
      '#type' =&gt; 'markup',
      '#markup' =&gt; t('&lt;a href="@login"&gt;Login&lt;/a&gt; or &lt;a href="@create"&gt;create account&lt;/a&gt;', array('@login' =&gt; url('user/login'), '@create' =&gt; url('user/register'))),
      '#weight' =&gt; -10, // Play with this value to control the height.
    );
  }
}