This cannot be done with vanilla AppleScript however I’m not sure but you could take a look at the NSEvent class using AppleScriptObjC. In Objective-C this is possible so it should be possible using AppleScriptObjC. You can add an event monitor and respond to the mouse down event and then sending a mouse up and mouse down event again repeatedly until you receive the mouse up event again (this is how auto clicker software works). You can choose to monitor certain application events but also the global events.
Clicking is quite easy and there are a lot of tools for that but monitoring mouse event and responding to them is not that easy in AppleScript.
Thanks, just what I was afraid for. So it’s the lower level API CoreGraphics that the TS will have to use indirectly then. CG can click and monitor process specific and global context, which I use in my scripting additions as well.