Sometimes I need to reuse same code inside the screen. One difference between this idea and function is that I need to reuse the elements and page context. Another is that I could transfer the flow avoiding code duplication
Can't you create a Action and reuse the same logic in multiple screens.
While not supported by OutSystems, a great forge component for achieving this is the Event System: http://www.outsystems.com/forge/component/597/Event+System/
It allows you to make event handlers and point them to screen actions. You can then trigger an event handler from another screen action, making your screen actions reusable.