"**Before**", in general:

This is about a kind of connection where an event in the past influences (dictates even) an assumption in the present.

> I met him before

... so now I am rightfully expected (kind of guaranteed) to be able to recognize him, or to know a thing or two about him.

>  I showed you before

... therefore I have the expectation (I assert, actually) that now you know how to do it.

We primarily rely on the impact of the thing that happened, and **it's not really important, and not emphasized when** it happened.

We only indicate the fact that it did (because it predicates the consequence, which is our actual interest).

-----

"**Before**", in your specific example:

> Do it like I showed you before

I don't think we say that.

I think, in a context where "earlier" does not feel right or necessary, we merely say:

> Do it like I've shown you

-----

"**Earlier**":

> I have mentioned earlier

> Do it like I showed you earlier

I sense both of these signify that "_not right now_", not even specifically recently, rather, _earlier (than that)_.

It's like an extra, proactive pointer for the listener to indicate where among their memories they should seek for the referred event.

Imagine how it could go down without the proactive pointer:

> Do it like I've shown you

> What? How? ( seeking in their immediate memories ) Have you you shown me? I don't seem to recall anything like that? What do you even mean?

> I meant, earlier.

> Ah... AH! Okay.

-----

So my conclusion in regards of time is that:

When using "before", there's no emphasis on time, rather on the consequence.

Though it's only fair noting that indeed, if the referred event happened very recently, using it would be weird, and thus it gets omitted or replaced:

> I recognize him, because I have met him before.

> I recognize him, because I met him yesterday.

or even, all of it pushed into the past:

> I recognized him, because I had met him before.

> I recognized him, because I met him the previous day.


When using "earlier", it's a correction, modifying "now-ish" to "a while ago".

The impression of its relation to more recent events stems from the circumstance that its usage becomes necessary when emphasis is needed to clarify that something had not taken place especially recently.