Fixed detection of the module functions used in script - we need to look also into the logical expressions (like IF and WHILE conditions)
Credits for reportind and helping with the troubleshooting go to Justin Zondagh

(cherry picked from commit ab22467a2ed8af97ba89ce53144d4414dbcd5a52)