Really, this kind of stuff seems to belongs in a factory and controller. The link function in the directive is mainly for DOM manipulation, but you are doing model manipulation and making your life more difficult.
But to answer your question you are having trouble because of timing of the link function versus the compiling of the template.
To hackishly fix your problem try this:
if (scope.User.webpages_Roles.length > 0) {
// The true param at the end forces a scope.$apply() / digest cycle
$timeout(function () {
scope.SelectedValue = scope.User.webpages_Roles[0].RoleId;
}, 100, true);
}
Ideally you should have your "User" model in a .factory that has some convience methods on it like this plunkr