How can I do an optimization problem that involves finding a sequence?
Graph search

I recommend you formulate your problem as a graph search problem.  Each vertex represents a state of the system.  The state of the system lists the number of units you currently have and the number of each producer you currently have (e.g., "20 units, 1 A, 3 B's, and 0 C's").  You add an edge $s \to s'$ if you can get from state $s$ to state $s'$ in a single step.  The start state is "0 units,  0 A's, 0 B's, 0 C's".  The goal states are all states with 1000 units.

You can now use breadth-first search to find the shortest path from the start state to a goal state.

For better performance, use A*.  It's not too hard to construct a consistent and admissible heuristic that always underestimates the distance to the goal state.

As long as the number of producers is not too large, I expect this to be pretty efficient.

Greedy algorithm

It might be possible to build a greedy algorithm for your problem.

Consider a simplified variant where you are not allowed to sell producers you own, and where the number of units you have is allowed to go negative (you can still buy a producer even if it would put you in debt).  This has an efficient greedy solution.  In particular, consider the decision problem variant: given $t$, determine whether there exists a sequence that gets you to the goal within at most $t$ seconds.  This can be answered greedily.

Consider our first action.  We have $k$ options for actions: "buy $P_1$", "buy $P_2$", ..., or "buy $P_k$".  Note that it's always advantageous to make all your producer-buys as early as possible; there's no point in waiting.  Assume that for producer $P_i$ we have base cost $b_i$ and production $p_i$.  If we buy $P_i$, the net profit from that purchase (over the entire $t$-second time window) is $(t-1) p_i - b_i$.  So, for your first action, choose the action with largest net profit.  Now, for your second action, we have the same problem, except that $t$ is one smaller, so we can continue iteratively.  After $t$ seconds, we check whether the resulting sequence has reached a goal state.

[You can also consider a kind of exchange operation, where you compare "buy $P_i$ then $P_j$" to "buy $P_j$ then $P_i$".  You'll find that the decision rule for making that choice is as follows.  Associate to the action "buy $P_i$" a 'profit foregone if we defer buying $P_i$' value of $0.1 b_i + p_i$.  Determine which of $P_i$ or $P_j$ has lower 'profit foregone', and then choose to do that one first.]

You could check whether you can generalize this analysis to the case where you're allowed to sell producers and where you're not allowed to let the number of units owned go negative.  It looks a little tedious, so I'll leave the case analysis to you.