You can either use wait or return inside a function. Don't mix these two. When you call wait inside a function the calling function will procede in the next frame. In this case:
l_temp_2_int = f_check_str(l_temp_1_array_str);
wait_for(f_check_str);
l_temp_2_int will only get a value assigned if f_check_str returns a value in the exact frame it was called in. Otherwise the value will be random. On a quick look I don't see any reason why f_check_str should contain a wait. Does not make any sense to me.
Be careful. There already is a datatype BOOL and that's long. It does not make any sense to define a "bool" type for that function.