Basic functions within Adobe Analytics fall into the categories of 'Row' or 'Table', its imperative to be mindful of which type you are trying to employ.
Table Functions versus Row Functions
A table function is one where the output is the same for every row of the table. A row function is one where the output is different for every row of the table.
Median is a 'Table' function.
Couple of ideas to get you close:
1.) Use a cumulative custom metric to evaluate where historically the 50% of visit break point is - then create a calculated metric for % of visits that are that value or lower. This will allow you to trend if there is a change.
2.) Use nested if formulas to achieve a bucketed version of the median metric. Something like (if visits shorter than x divided by all visits is > .5 then x) You will need a number of if statements and need to start with your lower bucket.
There are a couple of screenshots in this tweet that provide direction.
Twitter