Refactors the termination detection in the rules DSL to properly handle if-block and if-else-block commands.
Adds new functions `commandsTerminateInPre`, `commandTerminatesInPre`, and `ifElseBlockTerminatesInPre`
to recursively check if command sequences terminate in the pre-phase.
Also improves the Parse function to try block syntax first with proper error handling and fallback to YAML.
Includes test cases for dead code detection with terminating handlers in conditional blocks.