The "usual way" to do this is if left blank then it can be set by something - like msg.tagID... in which case you would just test for that in the on input code... (with the property set by the user having priority)
The newer more flexible way is to maybe make it a typeInput TypedInput Widget : Node-RED - which can then be set to a string (str) or message property (msg) or other type as well - and gives more flexibility of the property that you would accept. For example the base64 node - node-red-nodes/70-base64.html at master · node-red/node-red-nodes · GitHub and Lines 40-43 and the .js file lines 7 and 12 etc...
Up to you
Ok so I implemented the second sugestion (TypedInput Widget) and I just wanted to leave some extra information and useful links for people with less experience (such as myself) who are trying to implement this.
This link has a minimal example of the TypedInput Widget's use.
To understand the .js part of this example and how the input is treated differently depending on the selected type, the documentation for the evaluateNodeProperty function of the RED.util utility helped me a lot as the example provided above does not use the msg type specifically, which needs an extra parameter in the evaluateNodeProperty function (the msg object itself).
@dceejay Thank you for the very fast and concise response which helped achieve exactly what I wanted to do.