IDE: PatternWindow. Added actions on ESCAPE and X-button
RubyScript: rb code simplifying
RubyScript: fix exception processing