Hi Kelly,
If you are planning to develop a custom program, then I don't think customization in any event would help.
However, as Bill suggested you can use standard transaction FKLOCK2 to cater your requirement.
Moreover, apart from FKLOCK2, there are two other standard transactions-FPSELP and FPSELPLOCK which you can use for setting\deleting locks both at contract account or at document level.
Hope it helps...
Thanks,
Amlan