How to grant userpoints only for modifying nodes last changed at least 20 days ago? I am not sure how to go about this. I use the Userpoints module in Drupal 7 to attribute points to users who create nodes ('reviews'). I also want to allow them to gain some points if they supersede or modify an existing node... but only if the previous creation/mod was done over 20 days before.

How can I do this with Rules? Or else, how should I code it manually?
Sorry to say, but the previous answer has some challenges:


Rules Event After saving new content is not the right event.
I disagree with the "You will need a custom module ...", since there is an out-of-the-Rules-box Rules Condition you can use ... Read on for more details on that. 


Here is a rule (in Rules Export format) that does what you're asking for:

{ "rules_grant_userpoints_after_updating_old_content" : {
    "LABEL" : "Grant userpoints after updating old content",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules", "userpoints_rules" ],
    "ON" : { "node_update" : [] },
    "IF" : [
      { "data_is" : {
          "data" : [ "node-unchanged:changed" ],
          "op" : "\u003C",
          "value" : "-20 days"
        }
      }
    ],
    "DO" : [
      { "userpoints_action_grant_points" : {
          "user" : [ "site:current-user" ],
          "points" : "123",
          "tid" : "0",
          "entity" : [ "" ],
          "description" : "Modify existing node (nid=[node:nid]) that was not updated in the last 20 days.",
          "operation" : "Grant points",
          "display" : "1",
          "moderate" : "default"
        }
      },
      { "userpoints_rules_get_current_points" : {
          "USING" : { "user" : [ "site:current-user" ], "tid" : "all" },
          "PROVIDE" : { "loaded_points" : { "total_points" : "Number of points in all categories together" } }
        }
      },
      { "drupal_message" : { "message" : "You now have [total-points:value] points" } }
    ]
  }
}


Some more details about the above rule:


Rules Event: After updating existing content (you may want to limit it to selected content types only).
Rules Condition: Token [node-unchanged:changed] is at least from 20 days ago.
Rules Actions:


Grant 123 user points (adapt the number and the other options as you want).
Load the current userpoints balance.
Display a message with the current userpoints balance.



If you have the Rules UI enabled (and the Userpoints Rules module, you should be able to just import the above rule in your own site.

PS: After you're convinced the rule works as you want, you may want to remove the last 2 Rules Actions about the message shown to the user after user points were granted.