Refactor sanitize rule literal

Because other array literals for this rule are not using %w[...].
Add test case for script element