if you put your code into a subroutine, you can exit that subroutine whenever a variable does not meet a condition. Eg. if the return value of Rhino.GetPoint is Null because you pressed ESC during the prompt:
Option Explicit
Call Main()
Sub Main()
Dim arrPoint_A, arrPoint_B
arrPoint_A = Rhino.GetPoint("First Point")
If IsNull(arrPoint_A) Then Exit Sub
arrPoint_B = Rhino.GetPoint("Second Point")
If IsNull(arrPoint_B) Then Exit Sub
Rhino.AddPoint arrPoint_A
Rhino.AddPoint arrPoint_B
End Sub
OnCancelScript() is not a RhinoScript method and serves a different purpose, it can be used if a tight loop is stopped using the ESC key. An example is shown here.