Improved detection of unused values

Now a warning is created even if the unused value is inside a do/end or if/else block.