To reference any of en Entry object's properties, just use <Entry object>.<property name>, like entry().name.
So, I opened an existing library of mine that already had an Update/Before trigger, and added one line.
The line was:
message("Last modified " + entry().lastModifiedTime);
After I edited and modified the first entry, I pressed the checkmark icon and saw the following at the bottom of the screen for two seconds:
Last modified Fri Apr 07 21:11:15 EDT 2017
Is this what you wanted? It is a JavaScript Date Object, so you can look up all the things you can do with a Date object and do it to entry().lastModifiedTime. If those things don't light your fire, you can check the box that says to load the moment.js library, and if you do that, you can then do all the things moment() can do with a Date object, which you can see at momentjs.com.
In general, tripping you use the scripts (Memento JavaScript Library) API from a JavaScript field won't work, though I haven't tried everything myself.
It sounds like you would need to do what you're doing in a Creating / Before opening and an Updating / Before opening trigger script, especially the latter. It should work there. You'd see it in an Entry View card, but not updated yet in a list entry.