Script/Ruby Sanctum: Some cleanup and minor fixes

Solves #8573
Closes #8490