I was looking to code Metropolis-within-Gibbs sampler for a specific model and in that process, stumbled on to an online supplement for a work-in-progress book,``Handbook of Modern Item Response Theory''.  The following document summarizes the main points from chapter-15 of the book. The document also contains WinBUGS code to estimate the parameters of 2PL model.

Building Metropolis Hastings sampler from scratch