Scenario 1 looks like a VBScript syntax error, so most likely a typo in your template code. Scenario 2 looks a bit more problematic, because its a database error. Scenario 3, 4, 5 and 6 all look like standard VBScript syntax errors again.
Some examples, Scenario 3:
If Rendermode() != "PreviewDynamic" Then
Has a syntax error and it mentions Expected 'Then'
so we know the error is somewhere before the Then
statement. Taking a closer look, you have parentesis behind the variable RenderMode
, which is incorrect, it should be:
If RenderMode != "PreviewDynamic" Then