This one is hard, each payment terms can only provide you with one due date calculation.
You would have to manually chose your due date for either the first timeframe or the second because only one can be a default.
Payment Terms Options, the closest that I could get, setting the due date calculation.
CM-7D would give you the 24th for the 7 months with 31 days but the 25th for the 4 with 30 days
CM+7D calculates for the 7th of the next month - so this works always.
Not the answer you were looking but maybe it helps.
Another thought is to setup a payment terms that does something really bizarre to the date as an indicator for the user to change to the 24th of the month.....
Good luck