We find in gemarah baba metsiah 102' which discusses a case when the renter was charged a certain amount for the year, and that year has 2' adar which brings about a conflict in between them whether the extra month was included in the years rent or not.
One opinion in the gemarah is that depending on when this dialogue is taking place we shall determine who the muchzak is and will have the upper hand in this unsolvable dispute.
If it is taking place in the beginning of the month then the owner has the upper hand since in the property he is always the muchzak. If we are at the end of the month when the renter has already lived there rent free then he shall be the muchzak in the money that the owner wants to extract from him.
Still the gemarah is not concerned about a renter which shall somehow get the dialogue to be pushed off until the end of the month which shall render him the muchzak. For were he to position the discussion in the end of the month we shall just let him be the muchzak.
From this we may take out that arranging the circumstances to your favor is of no concern and is fine to do.
Therefore we shall consider this act moral.
However let see, beezrat Hashem, that the entire payment of the rent he made, is null and void and the owner is still the muchzak.
Someone paying his debt can do so even when the receiver does not want to accept payment at this time, except if the halacha states that the receiver has a right to say he does not wish to be paid at this time or place. Therefore a person who decides to pay with his collateral he may do so without his consent.
However if the collateral was given to secure loan a' that this person owes him, he can not force him to take that as payment for loan b', since he has rights on his collateral to secure loan a', for him to pay loan b' with it would be equivalent to taking it back for himself which he certainly may not do.
In our case, when the landlord discovers that there was damage done, he certainly regrets his consent to take that as rent, and here you need his consent to pay up with it being that this money was designated to pay for those damages if there were any and not for rent payment.
(If the money was designated also for rent then too he may still say that it was designated for the next rent as well if he ends up staying.)
The idea that such a consent may be considered a tauus (mistake)and invalid is found in c'm' 25'5' where the judge ruled that one has to swear which in turn caused him to rather make a pesharah and avoid swearing.Then the judge was found to be mistaken in his ruling and thus the pesharah was considered a mistake even when done with a kinyan since it was clear that he resigned to a pesharah due to the shevuah.
By us as well it is clear that his consent was due to his not expecting damage which the money was set aside for.
Therefore we conclude that this trick shall not work being that when he realizes he was tricked he retracts from his consent and that money shall again be designated for the damages.