I fixed the issue of having too many end ifs in the top one
You actually have multiple issues in those scripts beyond the extra End IF in your posted example.
Your clock out script does not attempt to find the correct record for the current employee before clocking them out. Thus it could modify the record for "John's" time card when "Jim" clocks out and vice versa.
When logging in, you'll need to use either a relationship or a scripted find to access the employee's most recent timecard. Then check to see if that timecard record shows that the timeStampOut field is not empty. If it is empty, the employee did not log out the previous time.
And when logging out, the system should use the same method to access the employee's most recent timecard record and make sure that the TimeStampOut field is empty. If it is not empty, the employee failed to log in like they should.
And even this will not catch all possible errors as an employee could clock in on day 1 and fail to clock out, then fail to clock in on day 2, but then clocks out successfully--which then logs the employee as working continuously from the clock in time from day 1 to the clock out time for day 2. Thus, you should also have your script check for intervals between the time/date clocked in and the time/date clocked out that exceed a value beyond a certain ceiling--probably something like 20 hours (in seconds) to catch that specific error.
If you have this relationship:
Employees::EmployeeIDpk = TimeCards::EmployeeIDfk
You can sort the TimeCards Records in descending order by TimeStampIn in the relationship linking these two tables and then a reference to timecards from the Employees layout will automatically refer to the employee's most recent time card record.
Thanks for the tips, I've got a better idea on what to do now
Also these records will be checked every day by a floor manager so if someone did forget to punch in or out it would be figured out pretty quickly
And you can do a find for records where a field is empty by using a lone = sign in that field as your find criterion.