Several threads already exist about this. eg:
Nudge Blocker
Blocking nudges, buzzes or zumbidos [SOLVED]
[Request] Block on x nudges in x seconds
etc
-----------------------
For a script, see
CookieRevised's reply to [Request] Block on x nudges in x seconds
and change the internal variables of that script to:
jscript code:
var floodCount = 4; // max amount of nudges allowed in the time period
var floodTime = 60000; // period for floodchecking, in milliseconds
var blockTime = -1; // period the contact is being blocked, in milliseconds
// (-1 = indefinitely time, aka: contacts will not be unblocked automatically)
var blockMessage = true // true = contact will be notified that he is being blocked
// false = contact will not be notified
This will block any contact indefinitely when he/she nudges you 5 or more times. It notifies the contact that he/she is being blocked (I advise to leave this on, blocking a contact without letting him know why will either make him wanting to do it more or he either wont have a clue what he did wrong and will do it again).
Note that this old script uses Xniff. This is an ActiveX control which actually may not work for you (depending on the type of network and/or network card you use) and it may result in conflicts with other scripts which use this ActiveX control. So, if you experience problems (any kind of script related problems), disable and uninstall this script.
(Original Xniff info here)
Note that this is a very old script and may not work anymore on the newer Messenger versions with the newer Messenger Plus!. Use at your own risk.