I found it somewhat difficult to follow the flow here. Variables depending on other variables and four possible outcomes in the end.

I took a shot at rewriting it as a case statement, what do you think?

```ruby
def time_format(format, default = '%B %e, %Y %l:%M%P')
  case
  when format.blank?
    default
  when i18n_format = I18n.t("time.formats.#{format}", default: [:"date.formats.#{format}", '']).presence
    i18n_format
  when date_format = Time::DATE_FORMATS[format] || Date::DATE_FORMATS[format]
    if date_format.is_a?(Proc)
      default
    else
      date_format
    end
  when format.present?
    format
  else
    default
  end
end
```