To eliminate the need for the flag you could do it like this:
var element = _my_repo.SignInToYourAccount.UseAnotherAccount;
foreach (var item in _list)
{
if (item.GetInnerHtml().Equals(_account_name))
{
element = item;
break;
}
}
element.Click();
However, your couldcode can be greatly simplified with the Linq extension methods provided in the System.Linqnamespace:
var element = _list.FirstOrDefault(x => x.GetInnerHtml().Equals(_account_name)) ?? _my_repo.SignInToYourAccount.UseAnotherAccount;
element.Click();