I don't like to throw around the words scammed, or duped, or ripped off willy nilly. I'd be hesitant to automatically assume malice in the intentions of your mechanic. Competence, however, seems apparent in this case. I'm not sure if I personally would hand him $500 for the "diagnosis and repair" he's done so far, but it's becoming more and more apparent he doesn't really know what's going on with your vehicle, and hoping that swapping out a completely new engine will be easier than fixing the problem with yours. (which it may very well be) If i were in your shoes, I would definitely take it to a more competent mechanic.