If it ain't broke, don't fix it. If it is broke, well... There were a few things that were still in a "get around to it" status. As much as I hate to spend my entire 6 days of vacation working on code, I knew it had to be done.
Challenge Code
There were quite a few issues with challenges. Firstly, was duplication of code. I originally added code for the spawn challenges to each spawn location object collider and called it from the button press, launching the challenge. After attempts to fix it for months off and on, I gave up and decided it was time to rethink how it worked. I created a single class and then added each challenge with a list property for each challenge. This prevents all of the problems with class interactions. One class that does everything almost. All of the settings are done in string[], bool[], object[] and other types, keeping the interactions locally and much easier to control, duplicate settings side by side, etc. Though the challenges were all working basically, the main goal was to fix the challenge notifications. Now I can just load each challenge using a single method using the index integer, ie gameStart(3) and all settings for that challenge are retrieved using that index.
Liberator
The first fix, which was on the Liberator self help tablet (above). I ran into the same double-tap issue I was seeing with the weapons (click on.. click off.. grasshopper). This caused the indexing to not load the next item, but the item after the next. In turn, the same problem required the same resolution, a timed approach. The method was being called on both click and release. The solution was to implement a timer to not allow a second click until a timer had expired.
Elevators
The elevators were a living, breathing and complaining project all to themselves. I am still not sure it is 100% clean, but is now working as expected. Because the inner and outer doors span across multiple objects on multiple floors, throw in the elevator buttons on each floor and the elevator floor buttons inside the elevator, my limited brain capacity had issues comprehending a valid approach. The buttons were not overly difficult to complete, but the non-clickable actions of the elevator reaching the floor and opening the door was a bit harder. I ended up adding sensors which would fire both the inner and outer doors by using a trigger sensor on each floor and a triggering collider on the elevator. When the elevator entered the floor trigger, it opens both the inner and outer doors.
Music Zones
This was another one caused by adding additional "ambient music" zones to the map. The first issue I found was that in my rush to add new zones, I was inadvertently using the wrong tag validation. Because there was a similar player tag object on the player controller, it was trigger both the on state and off state as the player entered. Well, duh. I simply changed it to look for playercontroller by name instead of the tags. This way if I attach anything else to the player object, there is no chance of a repeat situation.
RJ Stiltskin
There were a few things that were not working with old RJ Stiltskin. One of which was the object destructible. I cleaned up and resized some of the elements, moved the maintenance desk to the other side of the room so that there was a better scattering of the pieces parts.

While I was at it, I also created a locked closet, openable by only RJ himself. A secret lab where RJ tinkers with some robotics of his own...
This in turn spawned some new graphics, sprites, etc.