I am a shy guy myself too and I sometimes consciously do what that guy does in your story. Ok let me tell you what a shy guy would most probably feel or be thinking in his mind if he does these:
1)I pass a female who I am interested or semi crush on, whatever you call it, I would be VERY nervous if we look at each other in the eyes. What if she looks away, does that mean she thinks I am ugly or a loser? I don't want to know that so I try not to look at them even if I like her. I can do 1 of the two things, nervously look away, which makes me and her both feel awkward, and pretty much saying to her that I feel insecure around her, which implies I like her, which could possibly make her look away, which is what I don't want to see in the first place. If I don't see it then in my head there is still this possibility that she'll like me, at least she wouldn't feel awkward when I am close to her and look at her from the corner of my eyes. This is because she wouldn't know I want her so hopefully she won't turn around and try to see if I have been looking at her. Or I can pretend she is transparent when I walk pass her or make her feel like I am too occupied to look at her, the advantage is that it looks natural, and I won't look insecure around her. However the disadvantage is the girl may get the impression that I don't like her and make her lose her interest in me when I really feel the opposite. -> basically us shy guys just don't want to know that we like someone so much and yet that person likes us so little, because it really hurts our already small self esteem.
Also, when he says he is shy in front of female, I think he means it. Ask yourself this question, are the 2 female co workers that the guy always talk around less pretty than you are? If yes and significantly, than he is pretty much saying that he is nervous around you, which means hefeel insecure, and guys do that only if they are interested in you. The reason why he said he is nervous around girls is just to indirectly say that, because you are a girl, and since he is not goona say I am shy in front of you instead. For myself I am shy infront of girls I want to date, other girls I am fine talking to, because I don't have worry whether I will ruin my chance with her by doing something silly accidently.
the surprise look is probably because he feels like "o crap I don't know what to do now to make me feel normal in front of her, because I wasn't expecting that'.
When shy guy is nervous he'll say opposite things to avoid attention or revealling his emotion. Eg a friend of mine came up and ask me if I liked a girl in our class back in high school, I did like her, but since everyone was listening, I said "no, I don't find her interesting at all." Then she totally lost her interest in me after I said that. I don't believe I said it and I still hate meself for it. Also I think my friend is a total jackass for asking the question in that situation. He ruined it for me.