About those 'maintenance_window' and 'default redirect' ...
This module 'ProxyPass' was intended to simulate the Apache ProxyPass and ProxyPassReverse directive.
As such, and for good measure, the iRule should confine itself to what it was designed for.
Obviously when you maintain a private copy you are free to do whatever suites you but,
for a module that is to be generally useful, it cannot incorporate the aforementioned features.
Same is true for your added 'if' on line 266: it breaks the intended use of rewriting
host and/or uri.
Cheers,
Opher.