Hooking into the user login block to modify prefill default text in username and password
To target a specific form you can use hook_form_FORM_ID_alter(), e.g.:

function MYMODULE_form_user_login_block_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['foo']['#default_value'] = 'bar';
}


If you'd rather do it all in one alter hook though, use the provided $form_id parameter instead of $form['#id']...it's guaranteed to be the right one.

function MYMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'user_login_block') {
    $form['foo']['#default_value'] = 'bar';
  }
}


As a side note, it's probably not working at the moment because you're negating the condition:

if ($form['#id'] !== 'user-login-block') {  


should be

if ($form['#id'] === 'user-login-block') {