How can I search for a user id in a custom field in my entries loop?
You would want to use the relatedTo() method of elementCriteriaModel.

{% set username = craft.request.segment(2) %}
{% set author = craft.users.username(username).first() %}
{% set entries = craft.entries.section('blog').relatedTo(author) %}


If you need both then you may need to merge the results.

{% set username = craft.request.segment(2) %}
{% set author = craft.users.username(username).first() %}
{% set authorEntries = craft.entries.section('blog').authorId(author.id).find() %}
{% set coAuthorEntries = craft.entries.section('blog').relatedTo(author).find() %}

{# merge authorEntries and coAuthorEntries #}
{% set entries = authorEntries|merge(coAuthorEntries) %}


Not tested. But should be close. Update: added .find() which will convert the elementCriteriaModel to an array so that the merge filter works properly.