No, you're not understanding it completely. 38% is the minimum amount of the pot you need to win when called. It might correlate with how much equity you have, but they are not the same. If you flop a 90% equity hand, such as a set, you figure to realize much more than 90% of the pot on the flop, because you will put bets in against hands that you dominate. If you flop a 30% equity hand, such as bottom pair, you will usually realize much less than 30% of the pot. Certain hands that you 3-bet will realize equity better than others, because they will flop more profitable hands such as TPGK or flush draws, oesds, and gutters, while others will realize equity poorly because they will rarely flop strong and often flop medium strength hands. This is why we 3-bet with 97s and call with KTo.

To answer your example question:

Villain opens button for 4bb and you're in the BB. You have three choices:

1) folding
2) 3-betting to 12bb
3) flatting for 3bb

1) EV(folding) = 0bb

This one is easy, since we know folding is always 0EV.

2) EV(3-betting to 12) = (0.39)*(5.5) + (0.091)*(-11) + (1-0.39-0.091)*(23*R - 11)

Copied from above. Again, R is the percentage of the postflop pot you will win, on average, when called.

3) EV(flatting for 3) = 8.5*R - 3

When you flat, the only outcome is that there will be postflop play in a pot of 8.5bb (minus rake). As before, R is the percentage of the pot you figure to win on average, and it is important to understand that this is not the same R as for 3-betting and getting called. That is a different pot vs a different range, and a different R altogether.

One more thing, the EV values will always be in big blinds or dollars, while the probabilities and equities will always be percentages (numbers between 0 and 1).