Stuck with program flow and freezing programm

Thanks for the advice.
I attached the parts of code in question. The first part is the bit checking the PIR's and the output as it is working without any problems.
The second attachment is showing the changes I have made to convert the bit of code into functions and how it is called.
If you need more code or what ever information please let me know.

And thanks for having a look at.

working_parts_of_code.ino (5.83 KB)

after_changed_to_function.ino (4.97 KB)