I'm interested in the possibility of integrating an escrow mechanism into a blockchain. I know that escrow is often used to protect the interests of parties in various transactions, and I would like to know if similar functionality can be implemented using blockchain technology.
Yeah, it is possible and the relevant development is already in progress. For instance, BitEscrow project has proposed SDK which "implements a trust-less protocol for locking Bitcoin in escrow, without requiring a custodian for the funds".
You may try their engine to create the draft for such escrow contract and look at its details.