You're right, there is no built-in block that would vanish by itself over time, so you'll need to create your own system.
Step 1: Know where the block was placed
There are many ways to know where a block was placed, the most common one being raycasting. This one is not without its faults however, including not being 100% reliable and requiring some advanced commands / the usage of datapacks/functions for it to work properly.
So I recommend in your specific situation (highly controlled environment, single type of block) to use a different approach: Give the players (re-textured) spawn eggs instead of blocks. Let these spawn eggs then summon a marker entity with special tags that you can detect to place the block manually. Here is an example using a bat spawn egg item and a marker with the new
tag.
# the give command
/give @p bat_spawn_egg{EntityTag:{id:"minecraft:marker",Tags:["new"]}} 15
# the system to detect the new marker and place the blocks
# run this on repeat
/execute at @e[type=marker,tag=new] run setblock ~ ~ ~ stone
Step 2: Remove the block after a while
Now that we have the block AND a marker at its position, we can use that marker to count the time it has existed, before we remove it again.
For that, we first need a dummy timer scoreboard.
# run once in chat
/scoreboard objectives add timer dummy
Then we can set all new
markers scores to the amount of time we want the block to stay around in ticks. 5 seconds = 100 ticks. We count down the score of all markers, and when they reach 0 we remove the block and the marker.
# run these on repeat, in a chain
# preferably in the same chain as the execute->setblock command above to make sure
# they execute in the correct order, which is important
/scoreboard players set @e[type=marker,tag=new] timer 100
/tag @e[type=marker,tag=new] remove new
/scoreboard players remove @e[type=marker,scores={timer=1..}] timer 1
/execute at @e[type=marker,scores={timer=..0}] run setblock ~ ~ ~ air
/kill @e[type=marker,scores={timer=..0}]
And there you have it, that's how you do that.
The nice thing about this system is that it's so easily modifiable, basically invisible to the players (if you change the spawn egg texture/model) and needs barely any commands. Want the block to stay around for a different time? Change the score that is given to the marker. Want the block to change over time? Just check for different scores of the marker and set the block accordingly.