Add a content editor web part to the document library page. On the content editor web part, add the following javascript. Be sure to modify the value for strAction to what you need. In this case, it is set to redirect to SomePage.aspx with the ListID and ItemID Parameters.
<script type="text/javascript">
function Custom_AddDocLibMenuItems(m, ctx) {
var strDisplayText = "Edit Item Metadata";
var strAction = "window.location.href='../../Pages/SomePage.aspx?ListID=" + ctx.listName.substr(1, 36) + "&ItemID=" + currentItemID + "';";
var strImagePath = "/_layouts/images/edititem.gif";
CAMOpt(m, strDisplayText, strAction, strImagePath);
CAMSep(m);
return false;
}</script>