I believe the ProjMPS
type would have most of what you need for the last part (projecting the MPS |b\rangle): https://github.com/ITensor/ITensors.jl/blob/main/src/mps/projmps.jl
You may need to modify some things though, like the product
function.