Open to Lan automatically

The proper way to do this is to host a server. If you're in the same local network (which a home network usually is), then it's pretty simple, you can skip most of the steps in the tutorial (archive) and just download the server, put it into a folder where you want to have all the server stuff, run it once with java -jar server.jar in a console (after switching to that folder with cd), change "eula=false" to "eula=true" in eula.txt to agree to the usage terms and you're done with the initial setup (and you can move your existing world there, modify settings, etc., if you want).
From then on you can always just start the server with the same java -jar server.jar command, which can be put into a desktop shortcut or similar, if you want.
On Windows, you can assing Ctrl+Alt+[key] key combinations to shortcuts, if you put them into the "all programs" folder of the start menu. On pretty much all Linux systems you can just bind keys to any console command directly.
When the server is running on a computer in the local network, it automatically appears in the "multiplayer" menu of Minecraft. You can also add it as one of the servers that are always in your list, that skips a few seconds of waiting until the server is discovered by your game.

The hacky way: You can automate clicking the buttons or running /publish using a click/keyboard macro. On Windows, I can recommend "TinyTask", on Linux "xdotool" or maybe "cnee", some people also like "AutoHotkey".