Alexey,
The use of your commands are well justified. However, the primitives
are more often used in plain TeX than in LaTeX. Consequently, I think
you'd be interested in the xifthen package, available via CTAN from
http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=xifthen
As stated in the package documentation, it adequately allows for the
kind of conditional constructs you require:
\ifthenelse{<test expression>}{<true code>}{<false code>}
where <test expression>, in terms of integers (or counters for that
matter), may include all the regular comparison tests. You will also
notice that it allows for calc-like comparisons for counters (the calc
package is also available via CTAN from
http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=calc). Just
read the complete documentation to understand the availabilities.
Hope this helps,
Werner