Pandemics are not a new phenomenon and people like Bill Gates have been talking about preparing for the next one for many years now. Did the US government have an official plan in place for what they're going to do in case a new dangerous virus starts spreading around? Specifically, did such a plan envision shutting down borders, enforcing a lockdown, distributing apps for contact tracing, closing schools and restaurants, etc? How did the US government plan to deal with the next respiratory virus prior to COVID?
What was the US government's official plan for dealing with future pandemics prior to 2020?
Did the US government have an official plan in place for what they're going to do in case a new dangerous virus starts spreading around?
Specifically, did such a plan envision shutting down borders, enforcing a lockdown, distributing apps for contact tracing, closing schools and restaurants, etc?
Yes, with the exception of "apps", it was all envisioned. See, Pandemic Influenza - Challenges and Preparation.
Social Disruption May Be Widespread
Plan for the possibility that usual services may be disrupted. These could include services provided by hospitals and other health care facilities, banks, stores, restaurants, government offices, and post offices.
Prepare backup plans in case public gatherings, such as volunteer meetings and worship services, are canceled.
Being Able to Work May Be Difficult or Impossible
- Find out if you can work from home.
Schools May Be Closed for an Extended Period of Time
For borders, see Chapter 5 — Transportation and Borders; shown, in part, below. Also see Does the US President have the power to quarantine a state or other locality?.
For intrastate actions, the plan calls for providing information to local authorities. The choice to impose a lockdown or closures is a state function, with guidance from the Centers for Disease Control and Prevention (CDC).
For contact tracing, see Reducing Disease Transmission and Rates of Illness.
In the initial stages of a domestic outbreak, it might be feasible to perform case tracking and contact tracing, with isolation of individuals with known pandemic influenza and voluntary quarantine of their close contacts. Antiviral post-exposure prophylaxis targeted at contacts of the first cases identified in the United States may slow the spread of the pandemic. Quarantine of case contacts has played an important role in the management of outbreaks of other diseases transmitted by large-particle droplets, but its role in containing influenza has not been fully defined.
For schools see Guidance for Schools (K-12).
How did the US government plan to deal with the next respiratory virus prior to COVID?
I think this is provided by the full text of the of the above referenced plan.
This Implementation Plan for the National Strategy for Pandemic Influenza further clarifies the roles and responsibilities of governmental and non-governmental entities, including Federal, State, local, and tribal authorities and regional, national, and international stakeholders, and provides preparedness guidance for all segments of society. (Preface)
Chapter 5 — Transportation and Borders
The containment of an influenza virus with pandemic potential at its origin, whether the outbreak occurs abroad or within the United States, is a critical element of pandemic response efforts. Containment is most effective when approached globally, with all countries striving to achieve common goals. While complete containment might not be successful, a series of containment efforts could slow the spread of a virus to and within the United States, thereby providing valuable time to activate the domestic response.
Our Nation’s ports of entry and transportation network are critical elements in our preparation for and response to a potential influenza pandemic. Measures at our borders may provide an opportunity to slow the spread of a pandemic to and within the United States, but are unlikely to prevent it. Moreover, the sheer volume of traffic and the difficulty of developing screening protocols to detect an influenza-like illness pose significant challenges. While we will consider all options to limit the spread of a pandemic virus, we recognize complete border closure would be difficult to enforce, present foreign affairs complications, and have significant negative social and economic consequences.
Measures to limit domestic travel may delay the spread of disease. These restrictions could include a range of options, such as reductions in non-essential travel and, as a last resort, mandatory restrictions. While delaying the spread of the epidemic may provide time for communities to prepare and possibly allow the production and administration of pre-pandemic vaccine and antiviral medications, travel restrictions, per se, are unlikely to reduce the total number of people who become ill or the impact the pandemic will have on any one community. Individual regions would still experience sharp surges in the demand for medical services and the need to meet such demand with local and regional personnel, resources, and capacity. Communities, States, the private sector, and the Federal Government will need to carefully weigh the costs and benefits of transportation measures when developing their response plans, including the effectiveness of an action in slowing the spread of a pandemic, its social and economic consequences, and its operational feasibility.
Border and transportation measures will be most effective in slowing the spread of a pandemic if they are part of a larger comprehensive strategy that incorporates other interventions, such as the adherence to infection control measures (hand hygiene and cough etiquette), social distancing, isolation, vaccination, and treatment with antiviral medications.
Not a direct answer here, but a few key points of reference for further reading.
Senate Majority Leader Mitch McConnell alleged that the Obama administration did not provide the Trump administration with any information about the threat of a possible pandemic during a May 11 Team Trump Facebook Live discussion with Lara Trump....
Soon after McConnell made his playbook comment, Ronald Klain, the White House Ebola response coordinator from October 2014 to February 2015, tweeted out a link to a document titled “Playbook for Early Response to High-Consequence Emerging Infectious Disease Threats and Biological Incidents.”
According to CNN White House Press Secretary Kayleigh McEnany referred to documents that superceded the Obama administration playbook. The more recent of these was a report on the 2019 simulation exercise known as Crimson Contagion. Among the key findings of that exercise, quoting from Wikipedia, were that "The United States lacks the production capacity to meet the demands for protective equipment and medical devices such as masks and ventilators imposed by a pandemic," and that the "States were unable to efficiently request resources due to the lack of a standardized request process."
Such problems were predicted by the Department of Defense at least as early as 2017