Other than the fact that you cannot use predicates as arguments of other predicates, you are also interpreting the sentence by saying that the rectangle that Anna is painting when she is painting a square is that the very square ... which is of course a very reasonable interpretation of that sentence, but if we go for a more literal interpretation, then we need say that if there is some square that she is painting, then she is painting some rectangle (which may or may not be that square ... indeed, when in English we use 'rectangle' we may be trying to emphasize that it is not a square, otherwise we would have said square). So, using that interpretation, we get:
Ex (Sx&Pax) -> Ex (Rx&Pax)
(E being the existential quantifier)