Hardwire or plug in for LED strip lighting?
No matter what you do, yes, you have to follow electrical codes (in North America, the NEC), and this means proper enclosures for any mains voltage stuff. The NEC doesn't have anything to say about low voltage (&lt;= 30V) wiring. 

Essentially this comes down to preference, there's no right answer as to what is 'better'. A hard-wired solution can have a neater final appearance, but it's also more work to install and very difficult to remove. 



Since what you're doing is kind of non-standard, I'd personally go with something easier to remove. 

Install an outlet somewhere up high and near the door frame, then install a light switch (wherever is convenient) wiring it so the switch controls half the outlet. I'd look for a plug-in type transformer ("wall wart" style), wire it to the LED strip and plug it into the controlled outlet. 



If you trim excess wire from the transformer (and maybe even run a small bit of stick-on conduit) it will still be very neat, and the benefit is you can completely remove the LED strip and be left with a standard plug and switch. Later someone could plug in their own light to this, or even convert the outlet to an actual light fixture (depending on where you put the outlet).