To calculate the payoff for the best dynamic strategy, we need a computer program, which traverses all variations choosing optimal path.
In this case such program is relatively simple, while variations aren’t that many. Thus the payoff for the best strategy is found. To produce a formulation of the strategy complicates matters a little bit. However, in this case with the maximum of only 4 card draws, the best strategy can be expressed in simple terms as well.
Spoiler for Optimal game
Was this result calculated?
The first two cards didn't seem to have that much effect in simulations.
Spoiler for My simulation
The code calculates the exact probability for the average payoff with the best strategy (unless I messed up.)
Both simulation and code must take into account the cards leaving the deck. Also, must discard invalid (in terms of strategy) variations. E.g., a draw like (13, 13, 8).
The criteria for the staying card on the third turn can be established analytically (see the spoiler.)