No 2x4s needed, you've whacked yourself already! What can you do. Sometimes, reading what LBS go thru whose WAs live nearby and see them from time to time, I wonder how I'd react in that kind of sitch. I think I'd probably have found it a lot harder to detach, at least w/o going real dark and going out of my way to avoid him. So I guess I'm not surprised that this would happen.
I have a suggestion. Do you ever visualize interactions w/ H and think about what you'd say or do during them? IOW, practice saying things? I sometimes find myself doing this in the a.m. when I'm getting ready for the day, thinking about upcoming meetings or discussions about work or other issues that might be sticky, sort of working out ahead of time things I might think about saying. I wonder if that might help you -- practicing (to yourself). I think for example maybe next time he comes by you should just paste a smile on your face, say "Oh hi, would you just lock up when you go, I have to go out" and leave -- have your excuse ready beforehand (meeting someone, getting your teeth whitened, going to check out a local thing like a free art show or something, whatever -- something you can do at the spur of the moment). If you don't want to actually leave, alternatively you can go off somewhere and immerse yourself in some little project. I'm not saying to act coldly, just brisk and cheerful and busy w/ your life.
Try to move on from this and not get too hung up on cause and effect of it. He's going to do whatever he wants and more importantly, he was going to do it anyway. Beating yourself up b/c you think you caused him to do or not do something is a real waste of time.
One thing I think this incident points out is how much you need to get your focus off him and onto you. You've made taken some great steps toward that but need more. I know it's hard when you're in this truly limbo stich but that means you need to work a little harder at it. I'm so glad you enjoyed the class and your bike. Do more stuff like that. Step by step you will find yourself and grow to love that person -- that's when what he's up to won't bug you so much. I promise you will feel better if you can just do this (and I think you can!).