Since the version 1.5, the scripts don't need to explicitly generate the thumbnails, they are updated by the server when it is needed.
To explicitly generate a thumbnail from a script in system add-ins you can use the functions:
Public Overridable Function ForcePagePreview(pageId As Integer, optionsName As String) As Boolean
or
Public Overridable Function ForcePagePreviewAsync(pageId As Integer, optionsName As String) As Boolean.
Note about ForcePagePreviewAsync
In version 1.6 or 1.5, it is recommended to use the ForcePagePreview function, rather than ForcePagePreviewAsync, as the latter may cause the system instability or crashes.
See also
Recreating thumbnails in 1.5 or newer