Customising Search Box in Search Results Adding OnBlur and OnFocus Attributes
If you want to add attributes to the form itself you need to do it on the $form array:

$form['#attributes']['onblur'] = "if (this.value == '') {this.value = '".$form['search-form']['#value']."';}";


I'm just guessing but I think you're expecting there to be a search-form element because that's the CSS ID of the form? That's not quite how it works with the FAPI, the elements are in a hierarchy that will eventually be rendered down to HTML. Until that rendering happens the elements have no concept of an ID/class etc., so you won't find them in the array under the ID/class.