This is exactly how I teach those I tutor to approach word problems in algebra, but it is a very basic technique that applies only to certain kinds of problems in algebra. It is not going to work for a problem in differential equations or constrained optimization.
Here is a more general approach. What am I trying to do and is there a mathematical discipline that will help me do it? If there is a mathematical technique that I think will work, I then ask myself what is already known and what must be discovered. Next I begin translating from English into the appropriate mathematical notation.
Now what you did follows that general approach.
What do I want to do? In your example, you want to find numbers that satisfy given conditions.
Is there a mathematical discipline that answers many such questions? In your example, the answer is algebra.
With respect to algebra problems, I have a standard technique: I assign a symbol to each unknown, and then I look for equations that equal the number of unknowns. And that is exactly what you did.
But if I was trying to solve a problem in optimizing a differential function subject to constraints, I'd use a different standard technique.
Ultimately, solving word problems cannot fully be reduced to rule. It involves "seeing" that certain mathematical techniques may apply and then having a systematic way to translate the problem into the form required by the technique. Once you get enough experience, you may see short cuts for certain kinds of problem.