You are doing everything correctly. Make sure that your first document has this MetadataUrlSlug not null.
var doc = DocumentHelper.GetDocuments("CMS.MenuItem").FirstOrDefault();
var val = ValidationHelper.GetString(doc.GetValue("DocumentName"), "");
Although if you are already has metadataPage
(Is it type of treenode?) Why can't you metadataPage.GetValue("MetadataUrlSlug")
?