Hi Sergey - a few ideas for you:
1) Split the process into two, log in as User A and run part 1, then log out and back in as User B and run part 2. Use a work queue to hold any data that part 1 collects for part 2.
2) Split the process into two, log in as User A on one machine A and as User B on another machine. Run process 1 and 2 on both machines simultaneously, making sure that part 2 only picks up work queue items that part 1 has already worked.
3) Use a single process, but include logic to detect the current Windows user (Utility - Environment) and only work the steps appropriate to the current user. Then run the process while logged in as User A, then log out and back in as User B and run the process again.