Kevin,
I see several questions that need answering, and also some future problems.
1. Possibly you are trying to do too much in one subroutine. Perhaps it would work better to first establish which direction the elvator is going to go, then jump to a subroutine that performs either an UP or DOWN, but not both.
2. What is there that says the Subroutine is "Done"? It appears that you are moving EITHER up or down within the SAME subroutine. So are you DONE when the elevator is EITHER all the way up or all the way down? If so, then you can use the Top Sensor I:0/3 to trigger a Return instruction (when elvator is UP). Apparently you do not have a bottom sensor, so have created a counter and bit B3:5 to indicate the Down Position. So use B3:5 to trigger a Return (when elevator is DOWN).
| I:0/3 |
| Top Sensor +-RET-----+ |
|--+--| |------+--+ +--|
| | | + Return + |
| | B3:5 | +---------+ |
| | Down Pos. | |
| +--| |------+ |
3. The counter should be used to track the elevator position in BOTH up and down directions. Simply add a rung with a CTD that is activated when the elevator is going up. I would switch your logic, and use Count Up when elevator is going up, and Count Down when elevator is going down. Then when C5:ACC = 0, elevator is all the way down, and when C5:ACC = 5, elevator is all the way up.